Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef TAO_NVLIST_H
00016 #define TAO_NVLIST_H
00017
00018 #include "ace/pre.h"
00019
00020 #include "ace/Unbounded_Queue.h"
00021
00022 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00023 # pragma once
00024 #endif
00025
00026 #include "tao/AnyTypeCode/AnyTypeCode_methods.h"
00027 #include "tao/AnyTypeCode/Any.h"
00028 #include "tao/AnyTypeCode/NVList_Adapter_Impl.h"
00029
00030 #include "ace/Unbounded_Queue.h"
00031 #include "ace/Thread_Mutex.h"
00032 #include "ace/Atomic_Op.h"
00033
00034
00035 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00036
00037 class TAO_InputCDR;
00038
00039 namespace CORBA
00040 {
00041 enum
00042 {
00043
00044 ARG_IN = 0x01,
00045 ARG_OUT = 0x02,
00046 ARG_INOUT = 0x04,
00047 IN_COPY_VALUE = 0x08,
00048 OUT_LIST_MEMORY = 0x10,
00049 DEPENDENT_LIST = 0x20,
00050
00051
00052 CTX_RESTRICT_SCOPE = 0x40,
00053 CTX_DELETE_DESCENDENTS = 0x80,
00054
00055
00056 INV_NO_RESPONSE = 0x100,
00057 INV_TERM_ON_ERR = 0x200,
00058 RESP_NO_WAIT = 0x400
00059 };
00060
00061 typedef TAO_Pseudo_Var_T<NamedValue> NamedValue_var;
00062 typedef TAO_Pseudo_Out_T<NamedValue> NamedValue_out;
00063
00064 typedef ULong Flags;
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079 class TAO_AnyTypeCode_Export NamedValue
00080 {
00081 friend class ::TAO_NVList_Adapter_Impl;
00082 friend class NVList;
00083 friend class Request;
00084
00085 public:
00086
00087 const char * name (void) const;
00088
00089
00090 Any_ptr value (void) const;
00091
00092
00093 Flags flags (void) const;
00094
00095
00096 static NamedValue * _duplicate (NamedValue *);
00097 static NamedValue * _nil (void);
00098
00099
00100 ULong _incr_refcnt (void);
00101 ULong _decr_refcnt (void);
00102
00103
00104 typedef NamedValue_ptr _ptr_type;
00105 typedef NamedValue_var _var_type;
00106 typedef NamedValue_out _out_type;
00107
00108 protected:
00109
00110
00111
00112
00113
00114
00115 ~NamedValue (void);
00116
00117 private:
00118
00119
00120
00121 NamedValue (void);
00122
00123 private:
00124
00125
00126 ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> refcount_;
00127
00128
00129 Any any_;
00130
00131
00132 Flags flags_;
00133
00134
00135 char * name_;
00136 };
00137
00138
00139
00140 typedef TAO_Pseudo_Var_T<NVList> NVList_var;
00141 typedef TAO_Pseudo_Out_T<NVList> NVList_out;
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 class TAO_AnyTypeCode_Export NVList
00160 {
00161 friend class ::TAO_NVList_Adapter_Impl;
00162 friend class Request;
00163
00164 public:
00165
00166
00167 ULong count (void) const;
00168
00169
00170 NamedValue_ptr add (Flags);
00171
00172
00173 NamedValue_ptr add_item (const char *, Flags);
00174
00175
00176 NamedValue_ptr add_value (const char *, const Any &, Flags);
00177
00178
00179
00180 NamedValue_ptr add_item_consume (char *, Flags);
00181
00182
00183
00184 NamedValue_ptr add_value_consume (char *, Any_ptr, Flags);
00185
00186
00187 NamedValue_ptr item (ULong n);
00188
00189
00190
00191 void remove (ULong n);
00192
00193
00194 static NVList * _duplicate (NVList *);
00195 static NVList * _nil (void);
00196
00197
00198 ULong _incr_refcnt (void);
00199 ULong _decr_refcnt (void);
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209 void _tao_incoming_cdr (TAO_InputCDR & cdr,
00210 int flag,
00211 bool &lazy_evaluation);
00212
00213
00214
00215 void _tao_encode (TAO_OutputCDR & cdr, int flag);
00216
00217
00218 void _tao_decode (TAO_InputCDR & cdr, int flag);
00219
00220
00221
00222
00223
00224
00225 ptrdiff_t _tao_target_alignment (void);
00226
00227
00228
00229
00230
00231
00232 Boolean _lazy_has_arguments (void) const;
00233
00234
00235 typedef NVList_ptr _ptr_type;
00236 typedef NVList_var _var_type;
00237 typedef NVList_out _out_type;
00238
00239 protected:
00240
00241
00242
00243
00244
00245
00246 ~NVList (void);
00247
00248 private:
00249
00250
00251 NVList (void);
00252
00253
00254
00255 NamedValue_ptr add_element (Flags);
00256
00257
00258
00259 void evaluate (void);
00260
00261 private:
00262
00263 ACE_Unbounded_Queue<NamedValue_ptr> values_;
00264
00265
00266 ULong max_;
00267
00268
00269 ACE_Atomic_Op<TAO_SYNCH_MUTEX, unsigned long> refcount_;
00270
00271
00272 TAO_SYNCH_MUTEX lock_;
00273
00274
00275
00276
00277
00278
00279 TAO_InputCDR * incoming_;
00280
00281
00282
00283 int incoming_flag_;
00284 };
00285 }
00286
00287 TAO_END_VERSIONED_NAMESPACE_DECL
00288
00289 #if defined (__ACE_INLINE__)
00290 # include "tao/AnyTypeCode/NVList.inl"
00291 #endif
00292
00293 #include "ace/post.h"
00294 #endif