Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

CORBA_SeqEx.h File Reference

#include <ace/Guard_T.h>
#include <ace/Thread_Mutex.h>
#include <ace/Recursive_Thread_Mutex.h>
#include <rtm/RTC.h>

Go to the source code of this file.

Namespaces

namespace  CORBA_Sequence_Util

Typedefs

typedef ACE_Guard< ACE_Thread_Mutex > Guard
typedef ACE_Read_Guard< ACE_Thread_Mutex > Read_Guard
typedef ACE_Write_Guard< ACE_Thread_Mutex > Write_Guard
typedef ACE_Guard< ACE_Recursive_Thread_Mutex > Guard_r
typedef ACE_Read_Guard< ACE_Recursive_Thread_Mutex > Read_Guard_r
typedef ACE_Write_Guard< ACE_Recursive_Thread_Mutex > Write_Guard_r

Functions

template<class CorbaSequence, class Functor>
Functor for_each (const CorbaSequence &seq, Functor f)
 Apply the functor to all CORBA sequence elements.
template<class CorbaSequence, class Functor>
CORBA::Long find (const CorbaSequence &seq, Functor f)
 Return the index of CORBA sequence element that functor matches.
template<class CorbaSequence, class SequenceElement>
void push_back (CorbaSequecne &seq, SequenceElement elem)
 Push the new element back to the CORBA sequence.
template<class CorbaSequence, class SequenceElement>
void insert (CorbaSequence &seq, SequenceElement &elem, CORBA::ULong index)
 Insert the element to the CORBA sequence.
template<class CorbaSequence, class SequenceElement>
SequenceElement & front (CorbaSequence &seq)
 Get the front element of the CORBA sequence.
template<class CorbaSequence, class SequenceElement>
SequenceElement & back (CorbaSequence &seq)
 Get the last element of the CORBA sequence.
template<class CorbaSequence>
void erase (CorbaSequence &seq, CORBA::ULong index)
 Erase the element of the specified index.
template<class CorbaSequence>
void clear (CorbaSequence &seq)
 Erase all the elements of the CORBA sequence.


Typedef Documentation

typedef ACE_Guard<ACE_Thread_Mutex> Guard
 

typedef ACE_Guard<ACE_Recursive_Thread_Mutex> Guard_r
 

typedef ACE_Read_Guard<ACE_Thread_Mutex> Read_Guard
 

typedef ACE_Read_Guard<ACE_Recursive_Thread_Mutex> Read_Guard_r
 

typedef ACE_Write_Guard<ACE_Thread_Mutex> Write_Guard
 

typedef ACE_Write_Guard<ACE_Recursive_Thread_Mutex> Write_Guard_r
 


Function Documentation

template<class CorbaSequence, class SequenceElement>
SequenceElement& back CorbaSequence &  seq  ) 
 

Get the last element of the CORBA sequence.

This operation returns seq[seq.length() - 1].

Parameters:
seq The CORBA sequence to be get the element

template<class CorbaSequence>
void clear CorbaSequence &  seq  ) 
 

Erase all the elements of the CORBA sequence.

same as seq.length(0).

template<class CorbaSequence>
void erase CorbaSequence &  seq,
CORBA::ULong  index
 

Erase the element of the specified index.

This operation removes the element of the given index. The other elements are closed up around the hole.

Parameters:
seq The CORBA sequence to be get the element
index The index of the element to be removed

template<class CorbaSequence, class Functor>
CORBA::Long find const CorbaSequence &  seq,
Functor  f
 

Return the index of CORBA sequence element that functor matches.

This operation applies the given functor to the given CORBA sequence, and returns the index of the sequence element that the functor matches. The functor should be bool functor(const CORBA sequence element) type, and it would return true, if the element matched the functor.

Returns:
The index of the element that functor matches. If no element found, it would return -1.
Parameters:
seq CORBA sequence to be applied the functor
functor A functor to process CORBA sequence elements

template<class CorbaSequence, class Functor>
Functor for_each const CorbaSequence &  seq,
Functor  f
 

Apply the functor to all CORBA sequence elements.

Apply the given functor to the given CORBA sequence. functor should be void functor(CORBA sequence element).

Returns:
Functor that processed all CORBA sequence elements
Parameters:
seq CORBA sequence to be applied the functor
functor A functor to process CORBA sequence elements

template<class CorbaSequence, class SequenceElement>
SequenceElement& front CorbaSequence &  seq  ) 
 

Get the front element of the CORBA sequence.

This operation returns seq[0].

Parameters:
seq The CORBA sequence to be get the element

template<class CorbaSequence, class SequenceElement>
void insert CorbaSequence &  seq,
SequenceElement &  elem,
CORBA::ULong  index
 

Insert the element to the CORBA sequence.

Insert a new element in the given position to the CORBA sequence. If the given index is greater than the length of the sequence, the given element is pushed back to the last of the sequence. The length of the CORBA sequence will be expanded automatically.

Parameters:
seq The CORBA sequence to be inserted a new element
elem The new element to be inserted the sequence
index The inserting position

template<class CorbaSequence, class SequenceElement>
void push_back CorbaSequecne &  seq,
SequenceElement  elem
 

Push the new element back to the CORBA sequence.

Add the given element to the last of CORBA sequence. The length of the CORBA sequence will be expanded automatically.

Parameters:
seq CORBA sequence to be added a new element
elem The new element to be added to the CORBA sequence


Generated on Fri Jan 5 15:43:05 2007 for OpenRTM by  doxygen 1.4.1