Exemplo n.º 1
0
void
DeviceInstance::ThrowError(const std::string& message) const
{
   CMMError e = CMMError(message, MakeException());
   LOG_ERROR(Logger()) << e.getFullMsg();
   throw e;
}
Exemplo n.º 2
0
void ACacheManager::PushIntoCache(double lat, double lng, uint x, uint y, std::vector<SpectrumChannel>& vec) {
	LogD(0, "PushIntoCache(%lf, %lf, %d, %d, *vec*)\n", lat, lng, x, y);
	
	if (m_ChannelsRAMCache == nullptr || m_ChannelsDiskCache == nullptr)
		throw MakeException(std::runtime_error, std::string("You have to initialize the cache before calling ") + __func__ + "() function");
	
	m_ChannelsRAMCache->Push(x, y, vec);
	m_ChannelsDiskCache->WriteData(lat, lng, vec);
}
Exemplo n.º 3
0
void ACacheManager::InitializeCache(uint cell_width_count, uint cell_height_count) {
	LogD(0, "InitializeCache(%d, %d)\n", cell_width_count, cell_height_count);
	
	if (m_ChannelsRAMCache != nullptr || m_ChannelsDiskCache != nullptr)
		throw MakeException(std::runtime_error, std::string("The cache is already initialized.. which is a problem!"));
	
	m_ChannelsRAMCache = new SpectrumChannelsRAMCache(cell_width_count, cell_height_count);	
	m_ChannelsDiskCache = new SpectrumChannelsDiskCache(GetCurrentConfiguration());
}
Exemplo n.º 4
0
Arquivo: Image.cpp Projeto: rAum/rum
std::ostream& Image::serialize(std::ostream& ostr) const
{
	if (ostr.bad())
		throw MakeException("Bad output stream while serializing image");

	ostr.put(0);
	ostr.put(0);
	ostr.put(2); /* RGB without compression */
	ostr.put(0); ostr.put(0);
	ostr.put(0); ostr.put(0);
	ostr.put(0);
	ostr.put(0); ostr.put(0);           /* X origin */
	ostr.put(0); ostr.put(0);           /* Y origin */
	ostr.put((width & 0x00FF));
	ostr.put((width & 0xFF00) / 256);
	ostr.put((height & 0x00FF));
	ostr.put((height & 0xFF00) / 256);
	ostr.put(32);                        /* 32 bits*/
	ostr.put(0);

	ostr.write((char*)rgba, sizeof(uint) * width * height);

	return ostr;
}
Exemplo n.º 5
0
 void Run(void) override {
   MakeException();
 }
Exemplo n.º 6
0
std::vector<SpectrumChannel> ACacheManager::GetFromCache(uint x, uint y) {
	LogD(0, "GetFromCache(%d, %d)\n", x, y);
	if (m_ChannelsRAMCache == nullptr)
		throw MakeException(std::runtime_error, std::string("You have to initialize the cache before calling ") + __func__ + "() function");
	return m_ChannelsRAMCache->Get(x, y);
}