summaryrefslogtreecommitdiff
path: root/TAO/tao/Base_Connection_Property.h
blob: ecc1da8497d501d0aebc497820a6f6df0fcaa285 (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
/* -*- C++ -*- */
// $Id$

// ============================================================================
//
// = LIBRARY
//    TAO
//
// = FILENAME
//    Connection_Property.h
//
// = AUTHOR
//    Bala Natarajan <bala@cs.wustl.edu>
//
// ============================================================================

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

#include "tao/TAO_Export.h"

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

#if defined(_MSC_VER)
#if (_MSC_VER >= 1200)
#pragma warning(push)
#endif /* _MSC_VER >= 1200 */
#pragma warning(disable:4250)
#endif /* _MSC_VER */

#include "tao/corbafwd.h"

class TAO_Endpoint;

class TAO_Export TAO_Base_Connection_Property
{
  // = TITLE
  //     Abstracts the base properties of the connection, which will
  //     be used to look up connections in the cache
  //
  // = DESCRIPTION
  //     This class has the fundamental property of the connection
  //     viz. the peer to which it is connected. This class will be
  //     used to do a look up of the connection from the cache.
  //     Note 1: Additional properties for connection like Qos,
  //     Priority that the RT folks would need, can be added by
  //     inheriting from this class.

public:

  TAO_Base_Connection_Property (void);
  // Default constructor


  TAO_Base_Connection_Property (TAO_Endpoint *endpoint,
                                CORBA::Boolean flag = 0);
  // Constructor

  virtual ~TAO_Base_Connection_Property (void);
  // Dtor

  // = Operations that need to be overloaded in all the inherited
  //   classes. Without these the caching of connections may not work
  //   right way.

  TAO_Base_Connection_Property (
      const TAO_Base_Connection_Property &rhs);
  // The copy constructor.

  virtual TAO_Base_Connection_Property *duplicate (void);
  // This call allocates and copies the contents of this class and
  // returns the pointer

  TAO_Endpoint *endpoint (void);
  // Return the underlying endpoint oject

  void operator= (const TAO_Base_Connection_Property &rhs);
  // Assignment operator (does copy memory).

  int operator== (const TAO_Base_Connection_Property &rhs) const;
  // Equality comparison operator

  int operator!= (const TAO_Base_Connection_Property &rhs) const;
  // Inequality comparison operator.

  u_long hash (void) const;
  // Generate hash value for our class

private:

  TAO_Endpoint *endpoint_;
  // The base property of the connection ie. the peer's endpoint
  // Note: This endpoint will have a minimal info about the
  // endpoint. This should not be used for any invocation.

  CORBA::Boolean endpoint_flag_;
  // Is the endpoint allocated on the heap? If so, we will have to
  // delete it when we destruct ourselves.
};

#if defined (__ACE_INLINE__)
# include "tao/Base_Connection_Property.i"
#endif /* __ACE_INLINE__ */

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