summaryrefslogtreecommitdiff
path: root/TAO/tao/Incoming_Message_Queue.h
blob: 3bb2c25a3cf6214d13edc1b81feb0bb26d416b72 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// -*- C++ -*-

//=============================================================================
/**
 *  @file Incoming_Queued_Message.h
 *
 *  $Id$
 *
 *  @author Balachandran Natarajan <bala@cs.wustl.edu>
 */
//=============================================================================

#ifndef TAO_INCOMING_MESSAGE_QUEUE_H
#define TAO_INCOMING_MESSAGE_QUEUE_H
#include "ace/pre.h"

#include "Pluggable_Messaging_Utils.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

/// Forward declarations
class ACE_Data_Block;
class TAO_ORB_Core;
class TAO_Queued_Data;
class TAO_Transport;

/**
 * @class TAO_Incoming_Message_Queue
 * //@@Bala: Documentation..
 */

class TAO_Export TAO_Incoming_Message_Queue
{
public:
  /// Ctor.
  TAO_Incoming_Message_Queue (TAO_ORB_Core *orb_core);

  /// Dtor.
  ~TAO_Incoming_Message_Queue (void);


  /// @@Bala:Docu
  /*  int add_message (ACE_Message_Block *block,
                   ssize_t missing_data,
                   CORBA::Octet byte_order);*/

  size_t copy_message (ACE_Message_Block &block);

  CORBA::ULong queue_length (void);

  int is_tail_complete (void);

  int is_head_complete (void);

  size_t missing_data (void) const;
  void missing_data (size_t data);


  TAO_Queued_Data *dequeue_head (void);
  TAO_Queued_Data *dequeue_tail (void);



  int enqueue_tail (TAO_Queued_Data *nd);

private:

  friend class TAO_Transport;

  /// @@Bala:Docu
  TAO_Queued_Data *get_node (void);

private:
  ///
  TAO_Queued_Data *queued_data_;

  /// @@Bala:Docu
  CORBA::ULong size_;

  TAO_ORB_Core *orb_core_;
};

class TAO_Export TAO_Queued_Data
{
public:
  TAO_Queued_Data (void);

  ~TAO_Queued_Data (void);

  static TAO_Queued_Data* get_queued_data (void);

  /// The actual message queue
  ACE_Message_Block *msg_block_;

  CORBA::Long missing_data_;

  CORBA::Octet byte_order_;

  CORBA::Octet major_version_;

  CORBA::Octet minor_version_;

  TAO_Pluggable_Message_Type msg_type_;

  TAO_Queued_Data *next_;
};


#if defined (__ACE_INLINE__)
# include "Incoming_Message_Queue.inl"
#endif /* __ACE_INLINE__ */

#include "ace/post.h"
#endif /*TAO_INCOMING_MESSAGE_QUEUE_H*/