Merge pull request #2309 from mitza-oci/warnings
[ACE_TAO.git] / ACE / examples / APG / Streams / MessageInfo.h
blobffc1ea1a25bf6c73d8c717d9b4fb8160618210f1
1 /* -*- C++ -*- */
2 #ifndef MESSAGE_INFO_H
3 #define MESSAGE_INFO_H
5 #include "ace/FILE_Addr.h"
6 #include "ace/SString.h"
8 /* Opaque class that represents a caller's ID */
9 class CallerId
11 public:
12 CallerId () : id_ (ACE_TEXT ("UNKNOWN"))
13 { }
15 CallerId (ACE_TString id) : id_(id)
16 { }
18 const ACE_TCHAR * string()
20 return this->id_.c_str ();
23 private:
24 ACE_TString id_;
27 class MessageType
29 public:
30 enum {
31 // Known video codecs
32 FIRST_VIDEO_CODEC = 1,
34 DIVX,
35 // ...
36 LAST_VIDEO_CODEC,
38 // Known audio codecs
39 FIRST_AUDIO_CODEC,
41 MP3,
42 RAWPCM,
43 // ...
44 LAST_AUDIO_CODEC,
46 // Known text codecs
47 FIRST_TEXT_CODEC,
49 RAWTEXT,
50 XML,
52 // ...
53 LAST_TEXT_CODEC,
55 LAST_CODEC
58 MessageType (int codec, const ACE_FILE_Addr& addr)
59 : codec_(codec), addr_(addr)
60 { }
62 int get_codec ()
64 return this->codec_;
67 ACE_FILE_Addr &get_addr ()
69 return this->addr_;
72 int is_video ()
74 return
75 this->get_codec () > FIRST_VIDEO_CODEC &&
76 this->get_codec () < LAST_VIDEO_CODEC;
79 int is_audio ()
81 return
82 this->get_codec () > FIRST_AUDIO_CODEC &&
83 this->get_codec () < LAST_AUDIO_CODEC ;
86 int is_text ()
88 return
89 this->get_codec () > FIRST_TEXT_CODEC &&
90 this->get_codec () < LAST_TEXT_CODEC ;
93 private:
94 int codec_;
95 ACE_FILE_Addr addr_;
98 # endif /* MESSAGE_INFO_H */