00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifndef __WOSCMESSAGE_H__
00041 #define __WOSCMESSAGE_H__
00042
00043 #include "WOscLib.h"
00044 #include "WOscBlob.h"
00045 #include "WOscPacket.h"
00046 #include "WOscString.h"
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059 class WOSC_EXPORT WOscMessage: public WOscPacket{
00060 public:
00061 WOscMessage(const char* address);
00062 WOscMessage(const char* buffer, int bufferLen);
00063
00064 WOscMessage(const WOscMessage* message);
00065 WOscMessage(const WOscMessage& rhs);
00066 WOscMessage& operator= (const WOscMessage& rhs);
00067 WOscMessage& operator+= (const WOscMessage& rhs);
00068 WOscMessage operator+ (const WOscMessage& rhs);
00069
00070 virtual ~WOscMessage();
00071
00072 void Add(float f);
00073 void Add(int intArg);
00074 void Add(const char* s);
00075 void Add(WOscString& s);
00076 void Add(WOscBlob* b);
00077
00078 int GetNumFloats() const;
00079 int GetNumInts() const;
00080 int GetNumStrings() const;
00081 int GetNumBlobs() const;
00082
00083 const WOscString& GetOscAddress() const;
00084 const WOscString& GetOscTypeTag() const { return m_typeTag; }
00085
00086 float GetFloat(int idx) const;
00087 int GetInt(int idx) const;
00088 const WOscString& GetString(int idx) const;
00089 const WOscBlob* GetBlob(int idx) const;
00090
00091 void GetBuffer(char* buffer, int bufferLen);
00092 virtual const char* GetBuffer();
00093 int GetBufferLen();
00094
00095 private:
00096 void Copy(const WOscMessage &msg);
00097 WOscMessage();
00098
00099 void GenerateBufferFromMembers();
00100
00101 WOscString m_address;
00102 WOscString m_typeTag;
00103
00104 float* m_floats;
00105 int m_numFloats;
00106 int* m_ints;
00107 int m_numInts;
00108 WOscString* m_strings;
00109 int m_numStrings;
00110 WOscBlob** m_blobs;
00111 int m_numBlobs;
00112
00113 int m_bufferLen;
00114 char* m_buffer;
00115
00116 };
00117
00118 #endif // #ifndef __WOSCMESSAGE_H__