OpenDDS  Snapshot(2023/04/28-20:55)
SafetyProfileSequence.h
Go to the documentation of this file.
1 #ifndef OPENDDS_DCPS_SAFETYPROFILESEQUENCE_H
2 #define OPENDDS_DCPS_SAFETYPROFILESEQUENCE_H
3 
4 #include "SafetyProfilePool.h"
5 #include "PoolAllocationBase.h"
6 #include "Definitions.h"
7 #include "Serializer.h"
8 
9 #include <tao/Array_VarOut_T.h> // Array_Traits
10 #include <tao/String_Manager_T.h>
11 
12 #include <algorithm>
13 #include <memory>
14 #include <utility>
15 #include <cstddef>
16 #include <cstring>
17 
18 namespace OpenDDS {
19 namespace SafetyProfile {
20 
21  template <typename T>
22  struct StringTraits { };
23 
24  template <>
26  {
27  static CORBA::Char* alloc(CORBA::ULong len) { return CORBA::string_alloc(len); }
28  static CORBA::Char* empty() { return dup(""); }
29  static CORBA::Char* dup(const CORBA::Char* s) { return CORBA::string_dup(s); }
30  static void free(CORBA::Char* s) { if (s) CORBA::string_free(s); }
31 
32  static int cmp(const CORBA::Char* lhs, const CORBA::Char* rhs)
33  {
34  return std::strcmp(lhs, rhs);
35  }
36  };
37 
40 
41  template <seq_size_type N>
42  struct Bounded {
43  static const seq_size_type Bounds = N;
44  };
45 
46  struct Unbounded {
47  static const seq_size_type Bounds = INT_MAX;
48  };
49 
50  template <typename T, typename Sequence, typename Bounds>
51  struct AllocPolicy;
52 
53  template <typename T, typename Sequence, seq_size_type N>
54  struct AllocPolicy<T, Sequence, Bounded<N> > {
55  static T* allocbuf();
56  seq_size_type maximum() const { return N; }
57  seq_size_type max_size() const { return N; }
58  void replace(seq_size_type length, T* data, seq_flag_type release = false)
59  {
60  static_cast<Sequence&>(*this).replace_i(N, length, data, release);
61  }
62  protected:
63  explicit AllocPolicy(seq_size_type = N) {}
64  T* allocate(seq_size_type = N) const { return allocbuf(); }
65  void swap(AllocPolicy&) throw() {}
66  };
67 
68  template <typename T, typename Sequence>
70  static T* allocbuf(seq_size_type n);
71  seq_size_type maximum() const { return maximum_; }
72  seq_size_type max_size() const { return Unbounded::Bounds; }
73  void replace(seq_size_type maximum, seq_size_type length,
74  T* data, seq_flag_type release = false)
75  {
76  static_cast<Sequence&>(*this).replace_i(maximum, length, data, release);
77  }
78  protected:
79  explicit AllocPolicy(seq_size_type n = 0) : maximum_(n) {}
80  T* allocate(seq_size_type request = 0) const
81  {
82  return allocbuf(request ? request : maximum_);
83  }
84  void swap(AllocPolicy& rhs) throw() { std::swap(maximum_, rhs.maximum_); }
85  seq_size_type maximum_;
86  };
87 
88  /// Element Policy for sequence elements that are IDL "fixed-length" types.
89  /// These types don't need initialization or destruction of elements in their
90  /// allocbuf()/freebuf() functions.
91  /// @tparam T element type of the sequence
92  template <typename T>
94  typedef T& Element;
95  typedef const T& ConstElement;
96  typedef T ConstRawElement;
97  static const seq_size_type extra = 0;
98  static T& make_element(T& elt, seq_flag_type) { return elt; }
99  static void construct(T*, seq_size_type, seq_flag_type) {}
100  static void copy_n(const T* input, seq_size_type n, T* output);
101  static void move_n(T* in, seq_size_type n, T* out) { copy_n(in, n, out); }
102  static void reset_n(T*, seq_size_type) {}
103  static T* destroy(T* buffer, seq_size_type) { return buffer; }
104  };
105 
106  /// Element Policy for sequence elements that are IDL "variable-length" types
107  /// except for strings and arrays, which are handled separately.
108  /// @tparam T element type of the sequence
109  template <typename T>
110  struct VariEltPolicy {
111  typedef T& Element;
112  typedef const T& ConstElement;
113  typedef T ConstRawElement;
114  static const seq_size_type extra = 1;
115  static T& make_element(T& elt, seq_flag_type) { return elt; }
116  static void construct(T* buffer, seq_size_type n, seq_flag_type cookie);
117  static void copy_n(const T* input, seq_size_type n, T* output);
118  static void move_n(T* in, seq_size_type n, T* out);
119  static void reset_n(T* buffer, seq_size_type n);
120  static T* destroy(T* buffer, seq_size_type n);
121  };
122 
123  /// Element Policy for sequences of strings.
124  /// @tparam CharT FACE::Char or FACE::WChar
125  template <typename CharT>
127 
128  /// Indexing a non-const string sequence yields an object of this class.
129  /// This allows string memory management duing assignment.
130  struct Element {
131  Element(CharT*& element, seq_flag_type release)
132  : element_(element), release_(release) {}
133 
134  Element(const Element& elt)
135  : element_(elt.element_), release_(elt.release_) {}
136 
137  Element& operator=(const CharT* rhs)
138  {
139  ::TAO::String_var<CharT> tmp(rhs);
140  return move_from(tmp);
141  }
142 
143  Element& operator=(CharT* rhs)
144  {
145  ::TAO::String_var<CharT> tmp(rhs);
146  return move_from(tmp);
147  }
148 
149  Element& operator=(const ::TAO::String_var<CharT>& rhs)
150  {
151  ::TAO::String_var<CharT> tmp(rhs);
152  return move_from(tmp);
153  }
154 
155  Element& operator=(const ::TAO::String_Manager_T<CharT>& rhs)
156  {
157  ::TAO::String_var<CharT> tmp(rhs);
158  return move_from(tmp);
159  }
160 
161  operator const CharT*() const { return element_; }
162  const CharT* in() const { return element_; }
163  CharT*& inout() { return element_; }
164 
166  {
167  if (release_) StringTraits<CharT>::free(element_);
168  return element_;
169  }
170 
171  CharT* _retn()
172  {
173  CharT* const tmp = element_;
174  element_ = StringTraits<CharT>::empty();
175  return tmp;
176  }
177 
178  private:
180  {
181  if (release_) StringTraits<CharT>::free(element_);
182  element_ = rhs._retn();
183  return *this;
184  }
185 
186  CharT*& element_;
187  seq_flag_type release_;
188 
189  inline friend bool operator>>(DCPS::Serializer& ser, Element elt)
190  {
193  return ser.good_bit();
194  }
195  };
196 
197  static Element make_element(CharT*& elt, seq_flag_type release)
198  {
199  return Element(elt, release);
200  }
201 
202  typedef const CharT* ConstElement;
203  typedef const CharT* ConstRawElement;
204  static const seq_size_type extra = 1;
205  static void construct(CharT** buf, seq_size_type n, seq_flag_type cookie);
206  static void copy_n(const CharT* const* in, seq_size_type n, CharT** out);
207  static void move_n(CharT** in, seq_size_type n, CharT** out);
208  static void reset_n(CharT**, seq_size_type);
209  static CharT** destroy(CharT** buffer, seq_size_type n);
210  };
211 
212  /// Element Policy for sequences of arrays.
213  /// Currently arrays of fixed-length and variable-length elements are both
214  /// handled the same way, but optimizing the fixed-length element types could
215  /// be done here (they don't need construction, destruction, or cookies).
216  /// @tparam Forany the array's *_forany type generated by the IDL compiler
217  template <typename Forany, typename T = typename Forany::_array_type>
218  struct ArrayEltPolicy {
219  typedef T& Element;
220  typedef const T& ConstElement;
221  typedef const T ConstRawElement;
222  static const seq_size_type extra =
223  (sizeof(seq_size_type) - 1) / sizeof(T) + 1;
224  static T& make_element(T& elt, seq_flag_type) { return elt; }
225  static void construct(T* buffer, seq_size_type n, seq_flag_type use_cookie);
226  static void copy_n(const T* input, seq_size_type n, T* output);
227  static void move_n(T* in, seq_size_type n, T* out) { copy_n(in, n, out); }
228  static void reset_n(T* buffer, seq_size_type n);
229  static T* destroy(T* buffer, seq_size_type n);
230  };
231 
232  /// Generic base class for all IDL-defined sequences accepted by opendds_idl.
233  /// Derived classes (generated by opendds_idl) need to provide the following
234  /// methods to be compliant with the IDL-to-C++ specification:
235  /// If bounded:
236  /// - Constructors: default, copy, 3-arg
237  /// If unbounded:
238  /// - Constructors: default, copy, 1-arg (maximum), 4-arg
239  /// Both bounded and unbounded:
240  /// - Copy assignment
241  /// - non-member swap(), while not in spec this is useful for copy assignment
242  /// @tparam T element type of the sequence
243  /// @tparam Bounds either Bounded<N> or Unbounded
244  /// @tparam Elts element handling policy
245  template <typename T, typename Bounds, typename Elts = DefaultEltPolicy<T> >
246  class Sequence
247  : public AllocPolicy<T, Sequence<T, Bounds, Elts>, Bounds>
249  public:
250  typedef seq_size_type size_type; // from std C++ Container concept
251  typedef seq_size_type _size_type; // from IDL-to-C++ specification
252  typedef Elts ElementPolicy;
253 
254  protected:
255  explicit Sequence(size_type maximum = 0, size_type length = 0,
256  T* data = 0, seq_flag_type release = false);
257  Sequence(const Sequence& seq);
258  ~Sequence();
259  Sequence& operator=(const Sequence& seq);
260 
261  void swap(Sequence& rhs) throw();
262  public:
264  void length(size_type len);
265  size_type length() const { return length_; }
266 
267  typedef typename Elts::Element Element;
268  typedef typename Elts::ConstElement ConstElement;
269  typedef typename Elts::ConstRawElement ConstRawElement;
270 
271  typedef ConstElement const_subscript_type; // sequence _var compatibility
272  typedef Element subscript_type; // sequence _var compatibility
273 
274  ConstElement operator[](size_type idx) const;
275  Element operator[](size_type idx);
276 
277  seq_flag_type release() const { return release_; }
278 
279  T* get_buffer(seq_flag_type orphan = false);
280  const ConstRawElement* get_buffer() const;
281 
282  // allocbuf() inherited from AllocPolicy
283  static void freebuf(T* data);
284 
285 
286  // The public members below provide C++ standard library container
287  // compatibility for convenience.
288  // Iterators are always T* so be careful with string sequences,
289  // the caller needs to use FACE::string_free() and FACE::string_alloc()
290  // or FACE::string_dup() to replace a string in the sequence.
291  // These are the same semantics as get_buffer(bool) in the IDL-to-C++
292  // mapping.
293 
294  typedef T value_type;
295  typedef T& reference;
296  typedef const T& const_reference;
297  typedef T* iterator;
298  typedef const T* const_iterator;
299  typedef std::ptrdiff_t difference_type;
300 
301  const T* begin() const { return buffer_; }
302  T* begin() { return buffer_; }
303 
304  const T* end() const { return buffer_ + length_; }
305  T* end() { return buffer_ + length_; }
306 
307  bool operator==(const Sequence& rhs) const;
308  bool operator!=(const Sequence& rhs) const;
309 
310  size_type size() const { return length_; }
311  // max_size() inherited from AllocPolicy
312  bool empty() const { return !length_; }
313 
314  private:
315  friend struct AllocPolicy<T, Sequence, Bounds>;
316  void replace_i(size_type maximum, size_type length,
317  T* data, seq_flag_type release);
318 
319  private:
321  void lazy_alloc() const;
322 
323  size_type length_;
324  mutable seq_flag_type release_;
325  mutable T* buffer_;
326  };
327 
328 
329  // Allocation Policies:
330 
331  template <typename T, typename Sequence, seq_size_type N>
332  inline T* AllocPolicy<T, Sequence, Bounded<N> >::allocbuf()
333  {
334  void* const raw =
335  ACE_Allocator::instance()->malloc(N * sizeof(T));
336  T* const mem = static_cast<T*>(raw);
337  Sequence::ElementPolicy::construct(mem, N, false);
338  return mem;
339  }
340 
341  template <typename T, typename Sequence>
343  {
344  const size_t bytes = (n + Sequence::ElementPolicy::extra) * sizeof(T);
345  void* const raw = ACE_Allocator::instance()->malloc(bytes);
346  T* const mem = static_cast<T*>(raw);
347  Sequence::ElementPolicy::construct(mem, n, true);
348  return mem + Sequence::ElementPolicy::extra;
349  }
350 
351 
352  // Default Element Policy:
353 
354  template <typename T>
355  inline void DefaultEltPolicy<T>::copy_n(const T* in, seq_size_type n, T* out)
356  {
357  std::memcpy(out, in, n * sizeof(T));
358  }
359 
360 
361  // String Element Policy:
362 
363  template <typename CharT>
364  inline void StringEltPolicy<CharT>::construct(CharT** buffer, seq_size_type n,
365  seq_flag_type use_cookie)
366  {
367  for (seq_size_type i = use_cookie; i < n + use_cookie; ++i) {
368  buffer[i] = StringTraits<CharT>::empty();
369  }
370  if (use_cookie) {
371  *reinterpret_cast<seq_size_type*>(buffer) = n;
372  }
373  }
374 
375  template <typename CharT>
376  inline void StringEltPolicy<CharT>::copy_n(const CharT* const* in,
377  seq_size_type n, CharT** out)
378  {
379  for (seq_size_type i = 0; i < n; ++i) {
381  out[i] = StringTraits<CharT>::dup(in[i]);
382  }
383  }
384 
385  template <typename CharT>
386  inline void StringEltPolicy<CharT>::move_n(CharT** in, seq_size_type n,
387  CharT** out)
388  {
389  for (seq_size_type i = 0; i < n; ++i) {
390  std::swap(in[i], out[i]);
391  }
392  }
393 
394  template <typename CharT>
395  inline void StringEltPolicy<CharT>::reset_n(CharT** buffer, seq_size_type n)
396  {
397  for (seq_size_type i = 0; i < n; ++i) {
398  StringTraits<CharT>::free(buffer[i]);
399  buffer[i] = StringTraits<CharT>::empty();
400  }
401  }
402 
403  template <typename CharT>
404  inline CharT** StringEltPolicy<CharT>::destroy(CharT** buffer,
405  seq_size_type n_or_int_max)
406  {
407  seq_size_type n = n_or_int_max;
408  CharT** allocated = buffer;
409 
410  if (n_or_int_max == INT_MAX) {
411  allocated = buffer - 1;
412  n = *reinterpret_cast<seq_size_type*>(allocated);
413  }
414 
415  for (seq_size_type i = 0; i < n; ++i) {
416  StringTraits<CharT>::free(buffer[i]);
417  }
418 
419  return allocated;
420  }
421 
422 
423  // Variable-length Element Policy:
424 
425  template <typename T>
426  inline void VariEltPolicy<T>::construct(T* buffer, seq_size_type n,
427  seq_flag_type use_cookie)
428  {
429  std::uninitialized_fill_n(buffer + use_cookie, n, T());
430  if (use_cookie) {
431  *reinterpret_cast<seq_size_type*>(buffer) = n;
432  }
433  }
434 
435  template <typename T>
436  inline void VariEltPolicy<T>::copy_n(const T* in, seq_size_type n, T* out)
437  {
438  std::copy(in, in + n, out);
439  }
440 
441  template <typename T>
442  inline void VariEltPolicy<T>::move_n(T* in, seq_size_type n, T* out)
443  {
444  std::swap_ranges(in, in + n, out);
445  }
446 
447  template <typename T>
448  inline void VariEltPolicy<T>::reset_n(T* buffer, seq_size_type n)
449  {
450  std::fill_n(buffer, n, T());
451  }
452 
453  template <typename T>
454  inline T* VariEltPolicy<T>::destroy(T* buffer, seq_size_type n_or_int_max)
455  {
456  seq_size_type n = n_or_int_max;
457  T* allocated = buffer;
458 
459  if (n_or_int_max == INT_MAX) {
460  allocated = buffer - 1;
461  n = *reinterpret_cast<seq_size_type*>(allocated);
462  }
463 
464  for (seq_size_type i = 0; i < n; ++i) {
465  buffer[i].~T();
466  }
467 
468  return allocated;
469  }
470 
471 
472  // Array Element Policy:
473 
474  template <typename Forany, typename T>
476  seq_size_type n,
477  seq_flag_type use_cookie)
478  {
479  const seq_size_type start = use_cookie ? extra : 0;
480  for (seq_size_type i = start; i < n + start; ++i) {
482  }
483  if (use_cookie) {
484  *reinterpret_cast<seq_size_type*>(buffer) = n;
485  }
486  }
487 
488  template <typename Forany, typename T>
489  inline void ArrayEltPolicy<Forany, T>::copy_n(const T* in, seq_size_type n,
490  T* out)
491  {
492  for (seq_size_type i = 0; i < n; ++i) {
493  TAO::Array_Traits<Forany>::copy(out[i], in[i]);
494  }
495  }
496 
497  template <typename Forany, typename T>
498  inline void ArrayEltPolicy<Forany, T>::reset_n(T* buffer, seq_size_type n)
499  {
500  for (seq_size_type i = 0; i < n; ++i) {
502  }
503  }
504 
505  template <typename Forany, typename T>
506  inline T* ArrayEltPolicy<Forany, T>::destroy(T* buffer, seq_size_type n)
507  {
508  seq_size_type num = n;
509  T* alloc = buffer;
510 
511  if (n == INT_MAX) {
512  alloc = buffer - extra;
513  num = *reinterpret_cast<seq_size_type*>(alloc);
514  }
515 
516  for (seq_size_type i = 0; i < num; ++i) {
518  }
519 
520  return alloc;
521  }
522 
523 
524  // Members of the Sequence template itself:
525 
526  template <typename T, typename Bounds, typename Elts>
527  inline Sequence<T, Bounds, Elts>::Sequence(size_type maximum,
528  size_type length,
529  T* data, seq_flag_type release)
530  : AllocPolicy<T, Sequence, Bounds>(maximum)
531  , length_(length)
532  , release_(release)
533  , buffer_(data)
534  {
535  }
536 
537  template <typename T, typename Bounds, typename Elts>
539  : AllocPolicy<T, Sequence, Bounds>(seq.maximum())
540  , length_(seq.length_)
541  , release_(true)
542  , buffer_((seq.maximum() && seq.buffer_) ? allocate() : 0)
543  {
544  if (buffer_) {
545  Elts::copy_n(seq.buffer_, length_, buffer_);
546  }
547  }
548 
549  template <typename T, typename Bounds, typename Elts>
551  {
552  if (release_) {
553  freebuf(buffer_);
554  }
555  }
556 
557  template <typename T, typename Bounds, typename Elts>
560  {
561  Sequence cpy(seq);
562  swap(cpy);
563  return *this;
564  }
565 
566  template <typename T, typename Bounds, typename Elts>
567  inline void Sequence<T, Bounds, Elts>::swap(Sequence& rhs) throw()
568  {
570  std::swap(length_, rhs.length_);
571  std::swap(release_, rhs.release_);
572  std::swap(buffer_, rhs.buffer_);
573  }
574 
575  template <typename T, typename Bounds, typename Elts>
576  inline void Sequence<T, Bounds, Elts>::replace_i(size_type maximum,
577  size_type length, T* data,
578  seq_flag_type release)
579  {
580  Sequence tmp(maximum, length, data, release);
581  swap(tmp);
582  }
583 
584  template <typename T, typename Bounds, typename Elts>
586  {
587  if (!buffer_) {
588  buffer_ = allocate();
589  release_ = true;
590  }
591  }
592 
593  template <typename T, typename Bounds, typename Elts>
594  inline void Sequence<T, Bounds, Elts>::length(size_type len)
595  {
596  if (len <= maximum()) {
597  if (len && !buffer_) {
598  lazy_alloc();
599  }
600  else if (release_ && len < length_) {
601  Elts::reset_n(buffer_ + len, length_ - len);
602  }
603  length_ = len;
604  return;
605  }
606 
607  Sequence tmp(len, len, allocate(len), true);
608  Elts::move_n(buffer_, length_, tmp.buffer_);
609  swap(tmp);
610  }
611 
612  template <typename T, typename Bounds, typename Elts>
615  {
616  return buffer_[idx];
617  }
618 
619  template <typename T, typename Bounds, typename Elts>
620  inline typename Sequence<T, Bounds, Elts>::Element
622  {
623  return Elts::make_element(buffer_[idx], release_);
624  }
625 
626  template <typename T, typename Bounds, typename Elts>
627  inline T* Sequence<T, Bounds, Elts>::get_buffer(seq_flag_type orphan)
628  {
629  if (orphan && !release_) {
630  return 0;
631  }
632 
633  lazy_alloc();
634 
635  if (orphan) {
636  Sequence tmp;
637  swap(tmp);
638  tmp.release_ = false;
639  return tmp.buffer_;
640  }
641 
642  return buffer_;
643  }
644 
645  template <typename T, typename Bounds, typename Elts>
646  inline const typename Sequence<T, Bounds, Elts>::ConstRawElement*
648  {
649  lazy_alloc();
650  return buffer_;
651  }
652 
653  template <typename T, typename Bounds, typename Elts>
655  {
656  if (!data) return;
657  T* const allocated = Elts::destroy(data, Bounds::Bounds);
658  ACE_Allocator::instance()->free(allocated);
659  }
660 
661  template <typename T, typename Bounds, typename Elts>
662  inline bool Sequence<T, Bounds, Elts>::operator==(const Sequence& rhs) const
663  {
664  const size_type sz = size();
665  if (sz != rhs.size()) {
666  return false;
667  }
668  for (size_type i = 0; i < sz; ++i) {
669  if (!((*this)[i] == rhs[i])) {
670  return false;
671  }
672  }
673  return true;
674  }
675 
676  template <typename T, typename Bounds, typename Elts>
677  inline bool Sequence<T, Bounds, Elts>::operator!=(const Sequence& rhs) const
678  {
679  return !(*this == rhs);
680  }
681 }
682 }
683 
684 #endif /* dds_DCPS_SafetyProfileSequence_h */
static T & make_element(T &elt, seq_flag_type)
void swap(MessageBlock &lhs, MessageBlock &rhs)
static void construct(T *, seq_size_type, seq_flag_type)
void replace(seq_size_type length, T *data, seq_flag_type release=false)
static CORBA::Char * alloc(CORBA::ULong len)
void release(T x)
static CharT ** destroy(CharT **buffer, seq_size_type n)
static const seq_size_type Bounds
static T * destroy(T *buffer, seq_size_type)
static T * destroy(T *buffer, seq_size_type n)
char * string_alloc(ULong len)
static void construct(T *buffer, seq_size_type n, seq_flag_type cookie)
static void reset_n(T *buffer, seq_size_type n)
Element(CharT *&element, seq_flag_type release)
bool operator==(const Sequence &rhs) const
static void copy_n(const T *input, seq_size_type n, T *output)
virtual void free(void *ptr)=0
static void reset_n(T *, seq_size_type)
static Element make_element(CharT *&elt, seq_flag_type release)
static void copy_n(const CharT *const *in, seq_size_type n, CharT **out)
bool operator==(const DisjointSequence::OrderedRanges< T > &a, const DisjointSequence::OrderedRanges< T > &b)
static int cmp(const CORBA::Char *lhs, const CORBA::Char *rhs)
static void reset_n(T *buffer, seq_size_type n)
static void move_n(T *in, seq_size_type n, T *out)
const ConstRawElement * get_buffer() const
void replace_i(size_type maximum, size_type length, T *data, seq_flag_type release)
char * string_dup(const char *)
bool operator!=(const Sequence &rhs) const
ACE_CDR::ULong ULong
Class to serialize and deserialize data for DDS.
Definition: Serializer.h:369
ACE_CDR::Boolean Boolean
static CORBA::Char * dup(const CORBA::Char *s)
static ACE_Allocator * instance(void)
static void reset_n(CharT **, seq_size_type)
static void copy_n(const T *input, seq_size_type n, T *output)
size_t read_string(ACE_CDR::Char *&dest, StrAllocate str_alloc=0, StrFree str_free=0)
Definition: Serializer.cpp:520
void string_free(char *)
void replace(seq_size_type maximum, seq_size_type length, T *data, seq_flag_type release=false)
character_type * _retn(void)
bool operator!=(const GUID_t &lhs, const GUID_t &rhs)
Definition: GuidUtils.h:125
Sequence & operator=(const Sequence &seq)
static void construct(T *buffer, seq_size_type n, seq_flag_type use_cookie)
ConstElement operator[](size_type idx) const
static void copy_n(const T *input, seq_size_type n, T *output)
Element & operator=(const ::TAO::String_var< CharT > &rhs)
static void move_n(T *in, seq_size_type n, T *out)
static T & make_element(T &elt, seq_flag_type)
ACE_CDR::Char Char
DDS::ReturnCode_t copy(DDS::DynamicData_ptr dest, DDS::DynamicData_ptr src)
static void construct(CharT **buf, seq_size_type n, seq_flag_type cookie)
static void move_n(CharT **in, seq_size_type n, CharT **out)
ACE_HANDLE dup(ACE_HANDLE handle)
static void move_n(T *in, seq_size_type n, T *out)
static T * destroy(T *buffer, seq_size_type n)
Element & move_from(::TAO::String_var< CharT > &rhs)
static T & make_element(T &elt, seq_flag_type)
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
Sequence(size_type maximum=0, size_type length=0, T *data=0, seq_flag_type release=false)
virtual void * malloc(size_type nbytes)=0
Element & operator=(const ::TAO::String_Manager_T< CharT > &rhs)
friend bool operator>>(DCPS::Serializer &ser, Element elt)