📄 objects.hpp
字号:
/* ======================================================================== *\ | | | JOYIT Communication Technology | Copyright (C) 2002-2003, All Right Reserved. | | System: Programmable Signaling Gateway | Sub-system: MTP3 | Filename: objects.hpp | Environment: LINUX -- Red Hat 7.2 & GNU C/C++ Compiler 2.96 | vxWorks -- Tornado 2.0 & vxWorks 5.4 | Function description: Declare the base OBJECT. | |\* ======================================================================== */#ifndef _OBJECTS_HPP#define _OBJECTS_HPP#ifndef _EVENT_HPP#include "event.hpp"#endif// Class Name: WObject// Description: The minimal process entity. It is a virtual classs.// Method:// Data://class WObject{public: WObject( ); virtual ~WObject( );public: virtual void handleEvent(WEvent& event)=0; // Handle the event to me. virtual void getEvent(WEvent& event); // Get a event from the head of inner event queue. virtual void putEvent(WEvent& event); // Put a event into the tail of inner event queue. virtual void insert(WEvent& event); // Put a event as the head of inner event queue. virtual void idle( ); // When system is idle, this function will be called. virtual void deleteAll( ); // Delete all the event in the event queue.public: // static void error(ERRCOD_T werr, INT16 mid, const char * const errmsg = NULL); // Exception handle function. virtual void OAMagent( ); // Managed Object Agent function.public: INT16 SetObjectState(INT16 ost); // Set the object specify state. INT16 GetObjectState( ); // UINT16 GetEventQueueLength( ); // Get the length of the object's inner event queue. UINT32 SetMask(UINT32 em); // Set the event mask word. void ClearMask( ); // Clear all event mask. UINT32 GetMask( );protected: EventQueueType innerQueue; private: INT16 objectType; // Object type, there may be several objects belong to the same type. // INT16 objectId; // Object identifier in this system, every object has a unique id. INT16 oState; // Indicate the object's current state. It can be defined by User. UINT32 eventMask; // To set which type event can be handled.public: char tmpbuf[128];public: virtual char * name( );};const INT16 ostInit = 0, // Initialize state. ostSleep = 1, // Sleep state, no response to all event. ostNormal = 2, // Normal state, handle all the event in normal way. ostException = 3, // Exception state, some exception relate to me. ostExchange = 4, // Exchnage state, unstable state when exchange information between two objects. ostT1=5, ostUnknow = -1; // Unknow state.const short MAXINNERQ = 128;#endif// ------------------------------------------------------------------------//// Revision list.// ==============//// 1.0, 2003-04-18, Wu jianjin// Initial version.// 1.1, 2003-05-19, Wu jianjin// Ported to vxWorks.//// ------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -