|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// SError.h: interface for the SError class.
|
|
Toshihiro Shimizu |
890ddd |
//
|
|
Toshihiro Shimizu |
890ddd |
//////////////////////////////////////////////////////////////////////
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#if !defined(AFX_SERROR_H__25953AF0_0B0B_11D6_B96F_0040F674BE6A__INCLUDED_)
|
|
Toshihiro Shimizu |
890ddd |
#define AFX_SERROR_H__25953AF0_0B0B_11D6_B96F_0040F674BE6A__INCLUDED_
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include <string></string>
|
|
Toshihiro Shimizu |
890ddd |
#include <vector></vector>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "SDef.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class SError {
|
|
Toshihiro Shimizu |
890ddd |
protected:
|
|
Shinya Kitaoka |
120a6e |
std::string m_msg;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
SError() : m_msg(""){};
|
|
Shinya Kitaoka |
120a6e |
SError(const char *s) : m_msg(s){};
|
|
Shinya Kitaoka |
120a6e |
virtual ~SError(){};
|
|
Shinya Kitaoka |
120a6e |
virtual void debug_print() const {
|
|
Shinya Kitaoka |
120a6e |
/*if ( !m_msg.empty() )
|
|
Shinya Kitaoka |
120a6e |
smsg_error("Error %s!\n",m_msg.c_str());
|
|
Shinya Kitaoka |
120a6e |
else
|
|
Shinya Kitaoka |
120a6e |
smsg_error("\n"); */
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class SMemAllocError final : public SError {
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
SMemAllocError() : SError(""){};
|
|
Shinya Kitaoka |
120a6e |
SMemAllocError(const char *s) : SError(s){};
|
|
Shinya Kitaoka |
120a6e |
virtual ~SMemAllocError(){};
|
|
Shinya Kitaoka |
473e70 |
void debug_print() const override {
|
|
Shinya Kitaoka |
120a6e |
/* if ( !m_msg.empty() )
|
|
Shinya Kitaoka |
120a6e |
smsg_error("Error in Memory Allocation %s!\n",m_msg.c_str());
|
|
Shinya Kitaoka |
120a6e |
else
|
|
Shinya Kitaoka |
120a6e |
smsg_error("Error in Memory Allocation\n"); */
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class SWriteRasterError final : public SError {
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
SWriteRasterError() : SError(""){};
|
|
Shinya Kitaoka |
120a6e |
SWriteRasterError(const char *s) : SError(s){};
|
|
Shinya Kitaoka |
120a6e |
virtual ~SWriteRasterError(){};
|
|
Shinya Kitaoka |
473e70 |
void debug_print() const override {
|
|
Shinya Kitaoka |
120a6e |
/*if ( !m_msg.empty() )
|
|
Shinya Kitaoka |
120a6e |
smsg_error("Error in Writing Raster %s!\n",m_msg.c_str());
|
|
Shinya Kitaoka |
120a6e |
else
|
|
Shinya Kitaoka |
120a6e |
smsg_error("Error in Writing Raster\n"); */
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class SBlurMatrixError final : public SError {
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
SBlurMatrixError() : SError(""){};
|
|
Shinya Kitaoka |
120a6e |
SBlurMatrixError(const char *s) : SError(s){};
|
|
Shinya Kitaoka |
120a6e |
virtual ~SBlurMatrixError(){};
|
|
Shinya Kitaoka |
473e70 |
void debug_print() const override {
|
|
Shinya Kitaoka |
120a6e |
/* if ( !m_msg.empty() ) {
|
|
Shinya Kitaoka |
120a6e |
smsg_error("Error in Generating BlurMatrix %s!\n",m_msg.c_str());
|
|
Shinya Kitaoka |
120a6e |
} else
|
|
Shinya Kitaoka |
120a6e |
smsg_error("Error in Generating BlurMatrix!\n"); */
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
d1f6c4 |
class SFileReadError final : public SError {
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
SFileReadError() : SError(""){};
|
|
Shinya Kitaoka |
120a6e |
SFileReadError(const char *s) : SError(s){};
|
|
Shinya Kitaoka |
120a6e |
virtual ~SFileReadError(){};
|
|
Shinya Kitaoka |
473e70 |
void debug_print() const override {
|
|
Shinya Kitaoka |
120a6e |
/*if ( !m_msg.empty() ) {
|
|
Shinya Kitaoka |
120a6e |
smsg_error("Error in Reading File %s!\n",m_msg.c_str());
|
|
Shinya Kitaoka |
120a6e |
} else
|
|
Shinya Kitaoka |
120a6e |
smsg_error("Error in Reading File!\n"); */
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
#endif // !defined(AFX_SERROR_H__25953AF0_0B0B_11D6_B96F_0040F674BE6A__INCLUDED_)
|