BDE 4.39.x Production Release
Loading...
Searching...
No Matches
bdlar::SequenceRef Class Reference

#include <bdlar_sequenceref.h>

Public Member Functions

template<class t_SEQUENCE >
 SequenceRef (t_SEQUENCE &sequence, typename bsl::enable_if< IsSequence< t_SEQUENCE >::value >::type *=0)
 
 SequenceRef (void *objectAddress, const SequenceVtable *vtable)
 
template<class t_MANIPULATOR >
int manipulateAttribute (t_MANIPULATOR &manipulator, int attributeId) const
 
template<class t_MANIPULATOR >
int manipulateAttribute (t_MANIPULATOR &manipulator, const char *attributeName, int attributeNameLength) const
 
template<class t_MANIPULATOR >
int manipulateAttributes (t_MANIPULATOR &manipulator) const
 
void reset () const
 
template<class t_ACCESSOR >
int accessAttribute (t_ACCESSOR &accessor, int attributeId) const
 
template<class t_ACCESSOR >
int accessAttribute (t_ACCESSOR &accessor, const char *attributeName, int attributeNameLength) const
 
template<class t_ACCESSOR >
int accessAttributes (t_ACCESSOR &accessor) const
 
const SequenceVtablevtable () const
 
bool hasAttribute (int attributeId) const
 
bool hasAttribute (const char *attributeName, int attributeNameLength) const
 
void * objectAddress () const
 

Constructor & Destructor Documentation

◆ SequenceRef() [1/2]

template<class t_SEQUENCE >
bdlar::SequenceRef::SequenceRef ( t_SEQUENCE &  sequence,
typename bsl::enable_if< IsSequence< t_SEQUENCE >::value >::type *  = 0 
)
inlineexplicit

Create SequenceRef object that type erases the supplied sequence object.

◆ SequenceRef() [2/2]

bdlar::SequenceRef::SequenceRef ( void *  objectAddress,
const SequenceVtable vtable 
)
inline

Create SequenceRef object.

Precondition
The behaviour is undefined unless objectAddress and vtable point to the valid objects.

Member Function Documentation

◆ accessAttribute() [1/2]

template<class t_ACCESSOR >
int bdlar::SequenceRef::accessAttribute ( t_ACCESSOR &  accessor,
const char *  attributeName,
int  attributeNameLength 
) const
inline

Invoke the specified accessor on the (non-modifiable) attribute of the referred sequence object indicated by the specified attributeName and attributeNameLength, supplying accessor with the corresponding attribute information structure. The supplied accessor must be a callable type that can be called as if it had the following signature:

template <class t_INFO>
int accessor(const ATTRIBUTE& refOrValue, const t_INFO& info);

Return non-zero value if the attribute is not found, and the value returned from the invocation of accessor otherwise.

◆ accessAttribute() [2/2]

template<class t_ACCESSOR >
int bdlar::SequenceRef::accessAttribute ( t_ACCESSOR &  accessor,
int  attributeId 
) const
inline

Invoke the specified accessor on the (non-modifiable) attribute of the referred sequence object with the given attributeId, supplying accessor with the corresponding attribute information structure. The supplied accessor must be a callable type that can be called as if it had the following signature:

template <class t_INFO>
int accessor(const ATTRIBUTE& refOrValue, const t_INFO& info);

Return non-zero if the attribute is not found, and the value returned from the invocation of accessor otherwise.

◆ accessAttributes()

template<class t_ACCESSOR >
int bdlar::SequenceRef::accessAttributes ( t_ACCESSOR &  accessor) const
inline

Invoke the specified accessor sequentially on each attribute, supplying accessor with the corresponding attribute information structure until such invocation returns a non-zero value. The supplied accessor must be a callable type that can be called as if it had the following signature:

template <class t_INFO>
int accessor(const ATTRIBUTE& refOrValue, const t_INFO& info);

Return the value from the last invocation of accessor (i.e., the invocation that terminated the sequence).

◆ hasAttribute() [1/2]

bool bdlar::SequenceRef::hasAttribute ( const char *  attributeName,
int  attributeNameLength 
) const
inline

Return true if the referred sequence object has an attribute with the specified attributeName of the specified attributeNameLength, and false otherwise.

◆ hasAttribute() [2/2]

bool bdlar::SequenceRef::hasAttribute ( int  attributeId) const
inline

Return true if the referred sequence object has an attribute with the specified attributeId, and false otherwise.

◆ manipulateAttribute() [1/2]

template<class t_MANIPULATOR >
int bdlar::SequenceRef::manipulateAttribute ( t_MANIPULATOR &  manipulator,
const char *  attributeName,
int  attributeNameLength 
) const
inline

Invoke the specified manipulator on the (modifiable) attribute indicated by the specified attributeName and attributeNameLength, supplying manipulator with the corresponding attribute information structure. The supplied manipulator must be a callable type that can be called as if it had the following signature:

template <class t_INFO>
int manipulator(ATTRIBUTE *refOrValue, const t_INFO& info);

Return non-zero value if the attribute is not found, and the value returned from the invocation of manipulator otherwise.

◆ manipulateAttribute() [2/2]

template<class t_MANIPULATOR >
int bdlar::SequenceRef::manipulateAttribute ( t_MANIPULATOR &  manipulator,
int  attributeId 
) const
inline

Invoke the specified manipulator on the (modifiable) attribute indicated by the specified attributeId, supplying manipulator with the corresponding attribute information structure. The supplied manipulator must be a callable type that can be called as if it had the following signature:

template <class t_INFO>
int manipulator(ATTRIBUTE *refOrValue, const t_INFO& info);

Return non-zero value if the attribute is not found, and the value returned from the invocation of manipulator otherwise.

◆ manipulateAttributes()

template<class t_MANIPULATOR >
int bdlar::SequenceRef::manipulateAttributes ( t_MANIPULATOR &  manipulator) const
inline

Invoke the specified manipulator sequentially on each (modifiable) attribute, supplying manipulator with the corresponding attribute information structure until such invocation returns non-zero value. The supplied manipulator must be a callable type that can be called as if it had the following signature:

template <class t_INFO>
int manipulator(ATTRIBUTE *refOrValue, const t_INFO& info);

Return the value from the last invocation of manipulator (i.e., the invocation that terminated the sequence).

◆ objectAddress()

void * bdlar::SequenceRef::objectAddress ( ) const
inline

Return a pointer to the wrapped object.

◆ reset()

void bdlar::SequenceRef::reset ( ) const
inline

Reset the referred object to the default value.

◆ vtable()

const SequenceVtable * bdlar::SequenceRef::vtable ( ) const
inline

Return a pointer to the vtable.


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