#include <SafetyProfileSequence.h>
Inheritance diagram for OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >:
Public Types | |
typedef seq_size_type | size_type |
typedef seq_size_type | _size_type |
typedef Elts | ElementPolicy |
typedef Elts::Element | Element |
typedef Elts::ConstElement | ConstElement |
typedef Elts::ConstRawElement | ConstRawElement |
typedef ConstElement | const_subscript_type |
typedef Element | subscript_type |
typedef T | value_type |
typedef T & | reference |
typedef const T & | const_reference |
typedef T * | iterator |
typedef const T * | const_iterator |
typedef std::ptrdiff_t | difference_type |
Public Member Functions | |
void | length (size_type len) |
size_type | length () const |
ConstElement | operator[] (size_type idx) const |
Element | operator[] (size_type idx) |
seq_flag_type | release () const |
T * | get_buffer (seq_flag_type orphan=false) |
const ConstRawElement * | get_buffer () const |
const T * | begin () const |
T * | begin () |
const T * | end () const |
T * | end () |
bool | operator== (const Sequence &rhs) const |
bool | operator!= (const Sequence &rhs) const |
size_type | size () const |
bool | empty () const |
Static Public Member Functions | |
static void | freebuf (T *data) |
Protected Member Functions | |
Sequence (size_type maximum=0, size_type length=0, T *data=0, seq_flag_type release=false) | |
Sequence (const Sequence &seq) | |
~Sequence () | |
Sequence & | operator= (const Sequence &seq) |
void | swap (Sequence &rhs) throw () |
Private Member Functions | |
void | replace_i (size_type maximum, size_type length, T *data, seq_flag_type release) |
void | lazy_alloc () const |
Private Attributes | |
size_type | length_ |
seq_flag_type | release_ |
T * | buffer_ |
Friends | |
struct | AllocPolicy< T, Sequence, Bounds > |
Definition at line 245 of file SafetyProfileSequence.h.
typedef seq_size_type OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::_size_type |
Definition at line 250 of file SafetyProfileSequence.h.
typedef const T* OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::const_iterator |
Definition at line 297 of file SafetyProfileSequence.h.
typedef const T& OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::const_reference |
Definition at line 295 of file SafetyProfileSequence.h.
typedef ConstElement OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::const_subscript_type |
Definition at line 270 of file SafetyProfileSequence.h.
typedef Elts::ConstElement OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::ConstElement |
Definition at line 267 of file SafetyProfileSequence.h.
typedef Elts::ConstRawElement OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::ConstRawElement |
Definition at line 268 of file SafetyProfileSequence.h.
typedef std::ptrdiff_t OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::difference_type |
Definition at line 298 of file SafetyProfileSequence.h.
typedef Elts::Element OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::Element |
Definition at line 266 of file SafetyProfileSequence.h.
typedef Elts OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::ElementPolicy |
Definition at line 251 of file SafetyProfileSequence.h.
typedef T* OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::iterator |
Definition at line 296 of file SafetyProfileSequence.h.
typedef T& OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::reference |
Definition at line 294 of file SafetyProfileSequence.h.
typedef seq_size_type OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::size_type |
Definition at line 249 of file SafetyProfileSequence.h.
typedef Element OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::subscript_type |
Definition at line 271 of file SafetyProfileSequence.h.
typedef T OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::value_type |
Definition at line 293 of file SafetyProfileSequence.h.
OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::Sequence | ( | size_type | maximum = 0 , |
|
size_type | length = 0 , |
|||
T * | data = 0 , |
|||
seq_flag_type | release = false | |||
) | [inline, explicit, protected] |
Definition at line 528 of file SafetyProfileSequence.h.
Referenced by OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::get_buffer(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::operator=(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::replace_i().
00531 : AllocPolicy<T, Sequence, Bounds>(maximum) 00532 , length_(length) 00533 , release_(release) 00534 , buffer_(data) 00535 { 00536 }
OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::Sequence | ( | const Sequence< T, Bounds, Elts > & | seq | ) | [inline, protected] |
Definition at line 539 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_, and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length_.
00540 : AllocPolicy<T, Sequence, Bounds>(seq.maximum()) 00541 , length_(seq.length_) 00542 , release_(true) 00543 , buffer_((seq.maximum() && seq.buffer_) ? allocate() : 0) 00544 { 00545 if (buffer_) { 00546 Elts::copy_n(seq.buffer_, length_, buffer_); 00547 } 00548 }
OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::~Sequence | ( | ) | [inline, protected] |
T* OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::begin | ( | ) | [inline] |
Definition at line 301 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_.
00301 { return buffer_; }
const T* OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::begin | ( | ) | const [inline] |
Definition at line 300 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_.
00300 { return buffer_; }
bool OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::empty | ( | ) | const [inline] |
Definition at line 311 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length_.
00311 { return !length_; }
T* OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::end | ( | ) | [inline] |
Definition at line 304 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_, and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length_.
const T* OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::end | ( | ) | const [inline] |
Definition at line 303 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_, and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length_.
void OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::freebuf | ( | T * | data | ) | [inline, static] |
Definition at line 655 of file SafetyProfileSequence.h.
Referenced by OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::~Sequence().
00656 { 00657 if (!data) return; 00658 T* const allocated = Elts::destroy(data, Bounds::Bounds); 00659 ACE_Allocator::instance()->free(allocated); 00660 }
const Sequence< T, Bounds, Elts >::ConstRawElement * OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::get_buffer | ( | ) | const [inline] |
Definition at line 648 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_, and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::lazy_alloc().
00649 { 00650 lazy_alloc(); 00651 return buffer_; 00652 }
T * OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::get_buffer | ( | seq_flag_type | orphan = false |
) | [inline] |
Definition at line 628 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_, OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::lazy_alloc(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::release_, OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::Sequence(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::swap().
00629 { 00630 if (orphan && !release_) { 00631 return 0; 00632 } 00633 00634 lazy_alloc(); 00635 00636 if (orphan) { 00637 Sequence tmp; 00638 swap(tmp); 00639 tmp.release_ = false; 00640 return tmp.buffer_; 00641 } 00642 00643 return buffer_; 00644 }
void OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::lazy_alloc | ( | ) | const [inline, private] |
Definition at line 586 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_, and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::release_.
Referenced by OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::get_buffer(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length().
size_type OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length | ( | ) | const [inline] |
Definition at line 264 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length_.
00264 { return length_; }
void OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length | ( | size_type | len | ) | [inline] |
Definition at line 595 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_, OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::lazy_alloc(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length_, OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::release_, OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::Sequence(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::swap().
00596 { 00597 if (len <= maximum()) { 00598 if (len && !buffer_) { 00599 lazy_alloc(); 00600 } 00601 else if (release_ && len < length_) { 00602 Elts::reset_n(buffer_ + len, length_ - len); 00603 } 00604 length_ = len; 00605 return; 00606 } 00607 00608 Sequence tmp(len, len, allocate(len), true); 00609 Elts::move_n(buffer_, length_, tmp.buffer_); 00610 swap(tmp); 00611 }
bool OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::operator!= | ( | const Sequence< T, Bounds, Elts > & | rhs | ) | const [inline] |
Sequence< T, Bounds, Elts > & OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::operator= | ( | const Sequence< T, Bounds, Elts > & | seq | ) | [inline, protected] |
Definition at line 560 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::Sequence(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::swap().
bool OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::operator== | ( | const Sequence< T, Bounds, Elts > & | rhs | ) | const [inline] |
Definition at line 663 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::size().
00664 { 00665 const size_type sz = size(); 00666 if (sz != rhs.size()) { 00667 return false; 00668 } 00669 for (size_type i = 0; i < sz; ++i) { 00670 if (!((*this)[i] == rhs[i])) { 00671 return false; 00672 } 00673 } 00674 return true; 00675 }
Sequence< T, Bounds, Elts >::Element OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::operator[] | ( | size_type | idx | ) | [inline] |
Definition at line 622 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_, and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::release_.
Sequence< T, Bounds, Elts >::ConstElement OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::operator[] | ( | size_type | idx | ) | const [inline] |
Definition at line 615 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_.
00616 { 00617 return buffer_[idx]; 00618 }
seq_flag_type OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::release | ( | ) | const [inline] |
Definition at line 276 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::release_.
00276 { return release_; }
void OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::replace_i | ( | size_type | maximum, | |
size_type | length, | |||
T * | data, | |||
seq_flag_type | release | |||
) | [inline, private] |
Definition at line 577 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::Sequence(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::swap().
size_type OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::size | ( | ) | const [inline] |
Definition at line 309 of file SafetyProfileSequence.h.
References OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length_.
Referenced by OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::operator==().
00309 { return length_; }
void OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::swap | ( | Sequence< T, Bounds, Elts > & | rhs | ) | throw () [inline, protected] |
Definition at line 568 of file SafetyProfileSequence.h.
References OpenDDS::DCPS::swap().
Referenced by OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::get_buffer(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::operator=(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::replace_i().
00569 { 00570 AllocPolicy<T, Sequence, Bounds>::swap(rhs); 00571 std::swap(length_, rhs.length_); 00572 std::swap(release_, rhs.release_); 00573 std::swap(buffer_, rhs.buffer_); 00574 }
friend struct AllocPolicy< T, Sequence, Bounds > [friend] |
Definition at line 315 of file SafetyProfileSequence.h.
T* OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::buffer_ [mutable, private] |
Definition at line 326 of file SafetyProfileSequence.h.
Referenced by OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::begin(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::end(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::get_buffer(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::lazy_alloc(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::operator[](), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::Sequence(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::~Sequence().
size_type OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length_ [private] |
Definition at line 324 of file SafetyProfileSequence.h.
Referenced by OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::empty(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::end(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::Sequence(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::size().
seq_flag_type OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::release_ [mutable, private] |
Definition at line 325 of file SafetyProfileSequence.h.
Referenced by OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::get_buffer(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::lazy_alloc(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::length(), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::operator[](), OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::release(), and OpenDDS::SafetyProfile::Sequence< T, Bounds, Elts >::~Sequence().