Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# TAO_Base_Sequence Class Reference

Base class for TAO sequences. More...

`#include <Sequence.h>`

Inheritance diagram for TAO_Base_Sequence:

[legend]
List of all members.

## Public Methods
virtual | ~TAO_Base_Sequence (void)
| destructor. More...
CORBA::ULong | maximum (void) const
| return the maximum length of the sequence. More...
virtual void | _allocate_buffer (CORBA::ULong length)=0
virtual void | _deallocate_buffer (void)=0
| Must deallocate the buffer and then set it to zero. More...
virtual void | _shrink_buffer (CORBA::ULong new_length, CORBA::ULong old_length)
virtual void | _downcast (void *target, CORBA_Object *src ACE_ENV_ARG_DECL_WITH_DEFAULTS)
| Used for sequences of objects to downcast a recently demarshalled object reference into the right type. More...
virtual CORBA_Object * | _upcast (void *src) const
| Used for sequences of object to convert from the derived type into the Object class. More...
| TAO_Base_Sequence (const TAO_Base_Sequence &rhs)
TAO_Base_Sequence & | operator= (const TAO_Base_Sequence &rhs)
## Protected Methods
| TAO_Base_Sequence (void)
| Default constructor. More...
| TAO_Base_Sequence (CORBA::ULong maximum, CORBA::ULong length, void *buffer, CORBA::Boolean release=0)
| Constructor with control of ownership. More...
| TAO_Base_Sequence (CORBA::ULong maximum, void *buffer)
| Assume ownership and set length to 0. More...
CORBA::Boolean | release (void) const
| Returns the state of the sequence release flag. More...
## Protected Attributes
CORBA::ULong | maximum_
| The maximum number of elements the buffer can contain. More...
CORBA::ULong | length_
| The current number of elements in the buffer. More...
void * | buffer_
| The buffer with all the elements, casting must be done in derived classes. More...
CORBA::Boolean | release_
| If true then the sequence should release the buffer when it is destroyed. More...
## Friends
class | TAO_Marshal_Sequence
| We give access to TAO_Marshal_Sequence, this allows a safe yet small footprint implementation of the marshal engine. More...

## Detailed Description

Base class for TAO sequences.

This class provides a common interface for all IDL sequences, hence the interpreted marshal engine can manipulate them in a type safe manner.

## Constructor & Destructor Documentation

TAO_Base_Sequence::~TAO_Base_Sequence | ( | void |  | ) | `[virtual]`

| destructor.

ACE_INLINE TAO_Base_Sequence::TAO_Base_Sequence | ( | void |  | ) | `[protected]`

| Default constructor.

ACE_INLINE TAO_Base_Sequence::TAO_Base_Sequence | ( | CORBA::ULong | maximum,
|  | CORBA::ULong | length,
|  | void * | buffer,
|  | CORBA::Boolean | release = 0
| ) | `[protected]`

| Constructor with control of ownership.

ACE_INLINE TAO_Base_Sequence::TAO_Base_Sequence | ( | CORBA::ULong | maximum,
|  | void * | data
| ) | `[protected]`

| Assume ownership and set length to 0.

ACE_INLINE TAO_Base_Sequence::TAO_Base_Sequence | ( | const TAO_Base_Sequence & | rhs | ) |

## Member Function Documentation

virtual void TAO_Base_Sequence::_allocate_buffer | ( | CORBA::ULong | length | ) | `[pure virtual]`

| Ensure that the buffer contains space for at least <length> elements. The constructor must be called for any new elements, the old ones (if any) must be copied into the buffer using operator= and then their destructors must be called. Finally the old buffer must be released. Reimplemented in _TAO_Unbounded_Sequence_TAO_IIOPEndpointSequence, TAO_Unbounded_String_Sequence, TAO_Unbounded_WString_Sequence, TAO_Unbounded_Sequence< CORBA::Octet >, TAO_Unbounded_Sequence, TAO_Bounded_Sequence, TAO_Unbounded_Object_Sequence, TAO_Bounded_Object_Sequence, TAO_Unbounded_Pseudo_Sequence, TAO_Bounded_Pseudo_Sequence, TAO_Unbounded_Valuetype_Sequence, TAO_Bounded_Valuetype_Sequence, TAO_Unbounded_Array_Sequence, TAO_Bounded_Array_Sequence, TAO_Bounded_String_Sequence, TAO_Bounded_WString_Sequence, and TAO_Unbounded_Sequence< TAO_IOP_Tagged_Profile >.

virtual void TAO_Base_Sequence::_deallocate_buffer | ( | void |  | ) | `[pure virtual]`

| Must deallocate the buffer and then set it to zero. Reimplemented in _TAO_Unbounded_Sequence_TAO_IIOPEndpointSequence, TAO_Unbounded_String_Sequence, TAO_Unbounded_WString_Sequence, TAO_Unbounded_Sequence< CORBA::Octet >, TAO_Unbounded_Sequence, TAO_Bounded_Sequence, TAO_Unbounded_Object_Sequence, TAO_Bounded_Object_Sequence, TAO_Unbounded_Pseudo_Sequence, TAO_Bounded_Pseudo_Sequence, TAO_Unbounded_Valuetype_Sequence, TAO_Bounded_Valuetype_Sequence, TAO_Unbounded_Array_Sequence, TAO_Bounded_Array_Sequence, TAO_Bounded_String_Sequence, TAO_Bounded_WString_Sequence, and TAO_Unbounded_Sequence< TAO_IOP_Tagged_Profile >.

virtual void TAO_Base_Sequence::_downcast | ( | void * | target,
|  | CORBA_Object *src | ACE_ENV_ARG_DECL
| ) | `[virtual]`

| Used for sequences of objects to downcast a recently demarshalled object reference into the right type. Reimplemented in TAO_Unbounded_Object_Sequence, and TAO_Bounded_Object_Sequence.

void TAO_Base_Sequence::_shrink_buffer | ( | CORBA::ULong | nl,
|  | CORBA::ULong | ol
| ) | `[virtual]`

| Some sequences (of objects and strings) require some cleanup if the sequence is shrunk. The spec requires the destructor to release the objects only from position <0> to <length-1>; so shrink and then delete could result in a memory leak. Reimplemented in TAO_Unbounded_String_Sequence, TAO_Unbounded_WString_Sequence, TAO_Unbounded_Object_Sequence, TAO_Bounded_Object_Sequence, TAO_Unbounded_Pseudo_Sequence, TAO_Bounded_Pseudo_Sequence, TAO_Unbounded_Valuetype_Sequence, TAO_Bounded_Valuetype_Sequence, TAO_Bounded_String_Sequence, and TAO_Bounded_WString_Sequence.

CORBA_Object * TAO_Base_Sequence::_upcast | ( | void * | src | ) | const`[virtual]`

| Used for sequences of object to convert from the derived type into the Object class. Reimplemented in TAO_Unbounded_Object_Sequence, and TAO_Bounded_Object_Sequence.

ACE_INLINE CORBA::ULong TAO_Base_Sequence::maximum | ( | void |  | ) | const

| return the maximum length of the sequence.

ACE_INLINE TAO_Base_Sequence & TAO_Base_Sequence::operator= | ( | const TAO_Base_Sequence & | rhs | ) |

ACE_INLINE CORBA::Boolean TAO_Base_Sequence::release | ( | void |  | ) | const`[protected]`

| Returns the state of the sequence release flag.

## Friends And Related Function Documentation

friend class TAO_Marshal_Sequence`[friend]`

| We give access to TAO_Marshal_Sequence, this allows a safe yet small footprint implementation of the marshal engine. Reimplemented in TAO_Unbounded_Sequence< CORBA::Octet >.

## Member Data Documentation

void* TAO_Base_Sequence::buffer_`[protected]`

| The buffer with all the elements, casting must be done in derived classes.

CORBA::ULong TAO_Base_Sequence::length_`[protected]`

| The current number of elements in the buffer.

CORBA::ULong TAO_Base_Sequence::maximum_`[protected]`

| The maximum number of elements the buffer can contain.

CORBA::Boolean TAO_Base_Sequence::release_`[protected]`

| If true then the sequence should release the buffer when it is destroyed.

The documentation for this class was generated from the following files:

- Sequence.h
- Sequence.cpp
- Sequence.i