summaryrefslogtreecommitdiff
path: root/ACE/examples/APG/Streams/Message.h
blob: 29ddd30d5a1f9f9e49e40bb35ff9eaf8b113efac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* -*- C++ -*- */
// $Id$

#ifndef MESSAGE_H
#define MESSAGE_H

class RecordingDevice;

class Message
{
public:
  Message () : device_(0), type_(0), id_(0)
  { }

  ~Message ()
  { }

  RecordingDevice *recorder (void)
  {
    return this->device_;
  }

  void recorder (RecordingDevice *device)
  {
    this->device_ = device;
  }

  void type (MessageType *type)
  {
    this->type_ = type;
  }

  MessageType *type (void)
  {
    return this->type_;
  }

  void caller_id (CallerId *id)
  {
    this->id_ = id;
  }

  CallerId *caller_id (void)
  {
    return this->id_;
  }

  void addr (ACE_FILE_Addr &addr)
  {
    this->addr_ = addr;
  }

  void incoming_message (ACE_FILE_Addr &addr, MessageType *type)
  {
    this->addr_ = addr;
    this->type_ = type;
  }

  ACE_FILE_Addr &addr (void)
  {
    return this->addr_;
  }

  int is_text (void)
  {
    return this->type_->is_text ();
  }

  int is_audio (void)
  {
    return this->type_->is_audio ();
  }

  int is_video (void)
  {
    return this->type_->is_video ();
  }

private:
  RecordingDevice *device_;
  MessageType *type_;
  CallerId *id_;
  ACE_FILE_Addr addr_;
};

class AudioMessage : public Message
{ };

class VideoMessage : public Message
{ };

#endif /* MESSAGE_H */