00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef IPC_EXCEPTIONS_H
00010 #define IPC_EXCEPTIONS_H
00011
00012 #include <ers/Issue.h>
00013 #include <ers/Assertion.h>
00014
00020 #define IPC_ASSERT( x ) ERS_ASSERT_MSG( x, "of inconsistent internal state of the IPC library.\nThis indicates a bug in the application using IPC " \
00021 "or maybe in IPC itself." )
00022
00026 namespace daq {
00027
00035 ERS_DECLARE_ISSUE( ipc, Exception, , )
00036
00037
00040 ERS_DECLARE_ISSUE_BASE( ipc,
00041 CorbaException,
00042 ipc::Exception,
00043 "CORBA exception \"" << exception_name << "\" has been raised",
00044 ,
00045 ((std::string)exception_name )
00046 )
00047
00051 ERS_DECLARE_ISSUE_BASE( ipc,
00052 FileException,
00053 ipc::Exception,
00054 ,
00055 ,
00056 ((std::string)file_name )
00057 )
00058
00062 ERS_DECLARE_ISSUE_BASE( ipc,
00063 CannotOpenFile,
00064 ipc::FileException,
00065 "Can not open \"" << file_name << "\" file because " << reason,
00066 ((std::string)file_name ),
00067 ((std::string)reason )
00068 )
00069
00073 ERS_DECLARE_ISSUE_BASE( ipc,
00074 CannotReadFile,
00075 ipc::FileException,
00076 "Can not read from the \"" << file_name << "\" file because " << reason,
00077 ((std::string)file_name ),
00078 ((std::string)reason )
00079 )
00080
00084 ERS_DECLARE_ISSUE_BASE( ipc,
00085 CannotWriteFile,
00086 ipc::FileException,
00087 "Can not write to the \"" << file_name << "\" file because " << reason,
00088 ((std::string)file_name ),
00089 ((std::string)reason )
00090 )
00091
00095 ERS_DECLARE_ISSUE_BASE( ipc,
00096 InvalidInitialReference,
00097 ipc::Exception,
00098 "Invalid object reference \"" << reference << "\"",
00099 ,
00100 ((std::string)reference )
00101 )
00102
00106 ERS_DECLARE_ISSUE_BASE( ipc,
00107 InvalidObjectName,
00108 ipc::Exception,
00109 "Empty string is provided as the name of IPC object",
00110 ,
00111 )
00112
00116 ERS_DECLARE_ISSUE_BASE( ipc,
00117 UnknownOption,
00118 ipc::Exception,
00119 "Unknown option \"" << option_name << "\" is given ",
00120 ,
00121 ((std::string)option_name )
00122 )
00123
00127 ERS_DECLARE_ISSUE_BASE( ipc,
00128 BadOptionValue,
00129 ipc::Exception,
00130 "Bad value \"" << option_value << "\" is given to the \""
00131 << option_name << "\" option \" (" << reason << ")",
00132 ,
00133 ((std::string)option_name )
00134 ((std::string)option_value )
00135 ((std::string)reason )
00136 )
00137
00142 ERS_DECLARE_ISSUE_BASE( ipc,
00143 InvalidPartition,
00144 ipc::Exception,
00145 "Partition \"" << name << "\" does not exist",
00146 ,
00147 ((std::string)name )
00148 )
00149
00153 ERS_DECLARE_ISSUE_BASE( ipc,
00154 ObjectNotFound,
00155 ipc::Exception,
00156 "The object \"" << name << "\" of the \"" << type << "\" type is not published in the \""
00157 << partition << "\" partition ",
00158 ,
00159 ((std::string)partition )
00160 ((std::string)type )
00161 ((std::string)name )
00162 )
00163
00167 ERS_DECLARE_ISSUE_BASE( ipc,
00168 PluginException,
00169 ipc::Exception,
00170 "Loading of the \"" << plugin_name << "\" plugin failed because \"" << reason << "\"",
00171 ,
00172 ((std::string)plugin_name )
00173 ((std::string)reason )
00174 )
00175
00179 ERS_DECLARE_ISSUE_BASE( ipc,
00180 AlreadyInitialized,
00181 ipc::Exception,
00182 "IPCCore has been already initialized",
00183 ,
00184 )
00185
00190 ERS_DECLARE_ISSUE_BASE( ipc,
00191 NotInitialized,
00192 ipc::Exception,
00193 "IPCCore has not been yet initialized",
00194 ,
00195 )
00196
00200 ERS_DECLARE_ISSUE_BASE( ipc,
00201 CannotInitialize,
00202 ipc::Exception,
00203 "IPCCore initialization failed",
00204 ,
00205 )
00206 }
00207
00208 #endif