|
activemq-cpp-3.3.0
|
00001 00018 #ifndef _ACTIVEMQ_WIREFORMAT_OPENWIRE_UTILS_BOOLEANSTREAM_H_ 00019 #define _ACTIVEMQ_WIREFORMAT_OPENWIRE_UTILS_BOOLEANSTREAM_H_ 00020 00021 #include <decaf/io/DataInputStream.h> 00022 #include <decaf/io/DataOutputStream.h> 00023 #include <activemq/util/Config.h> 00024 00025 namespace activemq{ 00026 namespace wireformat{ 00027 namespace openwire{ 00028 namespace utils{ 00029 00049 class AMQCPP_API BooleanStream { 00050 private: 00051 00052 // Internal Buffer of data 00053 std::vector<unsigned char> data; 00054 00055 // Limit on buffer size 00056 short arrayLimit; 00057 00058 // Byte we are on from the buffer 00059 short arrayPos; 00060 00061 // Bit we are on in the byte we are on from the buffer 00062 unsigned char bytePos; 00063 00064 public: 00065 00066 BooleanStream(); 00067 00068 virtual ~BooleanStream() throw(); 00069 00077 bool readBoolean(); 00078 00085 void writeBoolean( bool value ); 00086 00093 void marshal( decaf::io::DataOutputStream* dataOut ); 00094 00101 void marshal( std::vector< unsigned char >& dataOut ); 00102 00109 void unmarshal( decaf::io::DataInputStream* dataIn ); 00110 00114 void clear(); 00115 00120 int marshalledSize(); 00121 00122 }; 00123 00124 }}}} 00125 00126 #endif /*_ACTIVEMQ_WIREFORMAT_OPENWIRE_UTILS_BOOLEANSTREAM_H_*/