📄 exceptionaction.hpp
字号:
/*** *** See the file "L2_RTI_EO1/disclaimers-and-notices-L2.txt" for *** information on usage and redistribution of this file, *** and for a DISCLAIMER OF ALL WARRANTIES. ***/#ifndef EXCEPTION_ACTION_H#define EXCEPTION_ACTION_H/** * This class specifies all actions that are to be performed upon encountering. * The member functions may be invoked inside the bodies of "catch" blocks, or * they can be called directly instead of throwing exceptions. * All member functions are static, and there are no data members. The class * simply supplies a scope. * \ingroup RTI */class ExceptionAction {private: /** Private and not defined to prevent instantiation. */ ExceptionAction();public: /** Tasks that can send a message. */ enum Sender { SND_LOGGING, SND_OBSERVATIONS_BUFFER, SND_POLICY, SND_REAL_TIME_INTERFACE, SND_TIMER }; /** Tasks that can receive a message. */ enum Receiver { RCV_LIVINGSTONE_DISPATCHER, RCV_LOG_HANDLER, RCV_REAL_TIME_INTERFACE, RCV_TELEMETRY }; /** * What to do when msgQSend() returns ERROR. * \param source the task that failed to send the message * \param destination the task to which the message was being sent * \param err the value of errno */ static void sendFailure(Sender source, Receiver destination, int err); /** * What to do when msgQRecv() returns ERROR. * \param destination the task that failed to receive the message * \param err the value of errno */ static void receiveFailure(Receiver destination, int err); /** * What to do when a file couldn't be opened. * \param pathname the file pathname that couldn't be opened */ static void logFileOpenFailure(const char* pathname); /** * What to do when Logging receives a message that is too long to enqueue. * \param logMessage the message that was too long */ static void logMessageTooLong(const char* logMessage); /** * What to do when a log file could not be opened. * \param message the message that was to be logged (this is ignored for now) * \param logMsgType the op code of the log message */ static void noLogFile(const char* message, int logMsgType); /** * What do do when a message to the L2Task contains an invalid op code. * \param opcode the invalid op code */ static void unhandledDispatcherOpcode(int opcode); /** * What to do when a message to the Logger contains an invalid op code. * \param opcode the invalid op code */ static void unhandledLoggerOpcode(int opcode); /** * What to do when a message to the RTI contains an invalid op code. * \param opcode the invalid op code */ static void unhandledRTIOpCode(int opcode); /** * What to do when Livingstone::read_file() fails. * \param modelFileName the pathname of the model file */ static void L2FailureToReadModelFile(const char* modelFileName); /** What to do when Livingstone::optimize() fails. */ static void L2FailureToOptimizeModel(); /** What to do when Livingstone::create_tracker() fails. */ static void L2FailureToCreateTracker(); /** * What do do when Livingstone couldn't be initialized for some reason that * the RTI could not determine. * \param s a C-string message from Livingstone describing the failure */ static void L2InitializationFailure(const char* s); /** What to do when the RTI reporter fails to determine or to encode * L2 internal variables/values. */ static void ReporterFailure(const char* errorMessage); /** * Map the Sender enum onto a C string. * \param sender a member of the Sender enum * \return a C string corresponding to the sender */ static const char* senderName(Sender sender); /** * Map the Receiver enum onto a C string. * \param receiver a member of the receiver enum * \return a C string corresponding to the receiver */ static const char* receiverName(Receiver receiver); // Accessor for errorCount, which is incremented for every ExceptionAction. static unsigned long getErrorCount(void); // Accessors for modelLoadedIndicator, which indicates success or failure to // load the L2 model. static unsigned short getModelLoadedIndicator(void); static void setModelLoadedIndicator(bool success); // Accessors for faultsDiagnosedIndicator, which indicates whether a failure // has been detected, other than the empty candidate. static unsigned short getFaultsDiagnosedIndicator(void); static void setFaultsDiagnosedIndicator(unsigned short faultDiagnosed);};#endif // EXCEPTION_ACTION_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -