00001
00002 #ifndef CDataBlock_h
00003 #define CDataBlock_h 1
00004
00005 namespace TASK {
00006
00007
00008
00009 typedef ACE_Data_Block ACE_Data_Block;
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 template <class MessageType>
00023 class CDataBlock : public ACE_Data_Block
00024 {
00025
00026 public:
00027 CDataBlock();
00028
00029 CDataBlock (MessageType *data);
00030
00031 ~CDataBlock();
00032
00033 const MessageType * get_data () const;
00034
00035
00036
00037 protected:
00038
00039
00040 private:
00041 CDataBlock(const CDataBlock< MessageType > &right);
00042
00043 CDataBlock< MessageType > & operator=(const CDataBlock< MessageType > &right);
00044
00045
00046
00047 private:
00048
00049
00050 MessageType *m_data;
00051
00052
00053
00054
00055 class Lock : public ACE_Lock_Adapter< ACE_Mutex >
00056 {
00057 public:
00058
00059 Lock() {};
00060 ~Lock() {};
00061 int destroy() { delete this; return 0; };
00062 protected:
00063 };
00064 };
00065
00066
00067
00068 template <class MessageType>
00069 inline const MessageType * CDataBlock<MessageType>::get_data () const
00070 {
00071 return m_data;
00072 }
00073
00074 }
00075
00076 #ifdef ACE_TEMPLATES_REQUIRE_SOURCE
00077 #include "CDataBlock.cpp"
00078 #endif
00079
00080 #endif