blob: 2d35ac4f475834fcf6467990835004259e9febf1 (
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
|
/* -*- C++ -*- */
/**
* @file Property_T.h
*
* $Id$
*
* @author Pradeep Gore <pradeep@oomworks.com>
*
*
*/
#ifndef TAO_NS_PROPERTY_T_H
#define TAO_NS_PROPERTY_T_H
#include "ace/pre.h"
#include "notify_export.h"
#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */
#include "ace/SString.h"
#include "orbsvcs/CosNotificationC.h"
class TAO_NS_PropertySeq;
/**
* @class TAO_NS_PropertyBase_T
*
* @brief
*
*/
template <class TYPE>
class TAO_NS_PropertyBase_T
{
public:
/// Constuctor
TAO_NS_PropertyBase_T (const char* name, const TYPE& initial);
/// Constuctor
TAO_NS_PropertyBase_T (const char* name);
/// Copy Constuctor
TAO_NS_PropertyBase_T (const TAO_NS_PropertyBase_T &rhs);
/// Destructor
~TAO_NS_PropertyBase_T ();
/// Assignment from TAO_NS_PropertyBase_T
// TAO_NS_PropertyBase_T& operator= (const TAO_NS_PropertyBase_T& rhs);
/// Assignment from TYPE
TAO_NS_PropertyBase_T& operator= (const TYPE& rhs);
/// Equality comparison operator.
int operator== (const TYPE &rhs) const;
/// Inequality comparison operator.
int operator!= (const TYPE &rhs) const;
/// Populate the Property Sequence with this valid value.
void get (CosNotification::PropertySeq& prop_seq);
/// Return the value.
const TYPE& value (void) const;
/// Is the current value valid
CORBA::Boolean is_valid (void) const;
/// Invalidate this property's value.
void invalidate (void);
protected:
/// The Property name.
const char* name_;
/// The value
TYPE value_;
/// Is the value valid
CORBA::Boolean valid_;
private:
ACE_UNIMPLEMENTED_FUNC (TAO_NS_PropertyBase_T& operator= (const TAO_NS_PropertyBase_T& rhs))
};
/*******************************************************************************/
/**
* @class TAO_NS_Property_T
*
* @brief
*
*/
template <class TYPE>
class TAO_NS_Property_T : public TAO_NS_PropertyBase_T<TYPE>
{
public:
/// Constuctor
TAO_NS_Property_T (const char* name, const TYPE& initial);
/// Constuctor
TAO_NS_Property_T (const char* name);
/// Assignment from TYPE
TAO_NS_Property_T& operator= (const TYPE& rhs);
/// Init this Property from the sequence.
/// Returns 0 on success, -1 on error
int set (const TAO_NS_PropertySeq& property_seq);
/// Init this Property from the CosNotification::PropertyValue
/// Returns 0 on success, -1 on error
int set (const CosNotification::PropertyValue &value);
};
/*******************************************************************************/
/**
* @class TAO_NS_StructProperty_T
*
* @brief
*
*/
template <class TYPE>
class TAO_NS_StructProperty_T
{
public:
/// Constuctor
TAO_NS_StructProperty_T (const char* name, const TYPE& initial);
/// Constuctor
TAO_NS_StructProperty_T (const char* name);
/// Init this Property from the sequence.
/// Returns 0 on success, -1 on error
int set (const TAO_NS_PropertySeq& property_seq);
/// Return the value.
const TYPE& value (void) const;
/// Is the current value valid
CORBA::Boolean is_valid (void) const;
protected:
/// The Property name.
const char* name_;
/// The value
TYPE value_;
/// Is the value valid
CORBA::Boolean valid_;
};
#if defined (__ACE_INLINE__)
#include "Property_T.inl"
#endif /* __ACE_INLINE__ */
#if defined (ACE_TEMPLATES_REQUIRE_SOURCE)
#include "Property_T.cpp"
#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */
#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA)
#pragma implementation ("Property_T.cpp")
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */
#include "ace/post.h"
#endif /* TAO_NS_PROPERTY_T_H */
|