BDE 4.14.0 Production release
Loading...
Searching...
No Matches
balb::Request Class Reference

#include <balb_testmessages.h>

Public Types

enum  { SELECTION_ID_UNDEFINED = -1 , SELECTION_ID_SIMPLE_REQUEST = 0 , SELECTION_ID_FEATURE_REQUEST = 1 }
 
enum  { NUM_SELECTIONS = 2 }
 
enum  { SELECTION_INDEX_SIMPLE_REQUEST = 0 , SELECTION_INDEX_FEATURE_REQUEST = 1 }
 

Public Member Functions

 Request (bslma::Allocator *basicAllocator=0)
 
 Request (const Request &original, bslma::Allocator *basicAllocator=0)
 
 ~Request ()
 Destroy this object.
 
Requestoperator= (const Request &rhs)
 Assign to this object the value of the specified rhs object.
 
template<class STREAM >
STREAM & bdexStreamIn (STREAM &stream, int version)
 
void reset ()
 
int makeSelection (int selectionId)
 
int makeSelection (const char *name, int nameLength)
 
SimpleRequestmakeSimpleRequest ()
 
SimpleRequestmakeSimpleRequest (const SimpleRequest &value)
 
FeatureTestMessagemakeFeatureRequest ()
 
FeatureTestMessagemakeFeatureRequest (const FeatureTestMessage &value)
 
template<class MANIPULATOR >
int manipulateSelection (MANIPULATOR &manipulator)
 
SimpleRequestsimpleRequest ()
 
FeatureTestMessagefeatureRequest ()
 
bsl::ostream & print (bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
 
template<class STREAM >
STREAM & bdexStreamOut (STREAM &stream, int version) const
 
int selectionId () const
 
template<class ACCESSOR >
int accessSelection (ACCESSOR &accessor) const
 
const SimpleRequestsimpleRequest () const
 
const FeatureTestMessagefeatureRequest () const
 
bool isSimpleRequestValue () const
 
bool isFeatureRequestValue () const
 
bool isUndefinedValue () const
 
const char * selectionName () const
 Return the symbolic name of the current selection of this object.
 

Static Public Member Functions

static int maxSupportedBdexVersion ()
 
static const bdlat_SelectionInfolookupSelectionInfo (int id)
 
static const bdlat_SelectionInfolookupSelectionInfo (const char *name, int nameLength)
 

Static Public Attributes

static const char CLASS_NAME []
 
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY []
 

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SELECTION_ID_UNDEFINED 
SELECTION_ID_SIMPLE_REQUEST 
SELECTION_ID_FEATURE_REQUEST 

◆ anonymous enum

anonymous enum
Enumerator
NUM_SELECTIONS 

◆ anonymous enum

anonymous enum
Enumerator
SELECTION_INDEX_SIMPLE_REQUEST 
SELECTION_INDEX_FEATURE_REQUEST 

Constructor & Destructor Documentation

◆ Request() [1/2]

balb::Request::Request ( bslma::Allocator basicAllocator = 0)
inlineexplicit

Create an object of type Request having the default value. Use the optionally specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ Request() [2/2]

balb::Request::Request ( const Request original,
bslma::Allocator basicAllocator = 0 
)

Create an object of type Request having the value of the specified original object. Use the optionally specified basicAllocator to supply memory. If basicAllocator is 0, the currently installed default allocator is used.

◆ ~Request()

balb::Request::~Request ( )
inline

Member Function Documentation

◆ accessSelection()

template<class ACCESSOR >
int balb::Request::accessSelection ( ACCESSOR &  accessor) const

Invoke the specified accessor on the non-modifiable selection, supplying accessor with the corresponding selection information structure. Return the value returned from the invocation of accessor if this object has a defined selection, and -1 otherwise.

◆ bdexStreamIn()

template<class STREAM >
STREAM & balb::Request::bdexStreamIn ( STREAM &  stream,
int  version 
)

Assign to this object the value read from the specified input stream using the specified version format and return a reference to the modifiable stream. If stream is initially invalid, this operation has no effect. If stream becomes invalid during this operation, this object is valid, but its value is undefined. If version is not supported, stream is marked invalid and this object is unaltered. Note that no version is read from stream. See the bslx package-level documentation for more information on bdex streaming of value-semantic types and containers.

◆ bdexStreamOut()

template<class STREAM >
STREAM & balb::Request::bdexStreamOut ( STREAM &  stream,
int  version 
) const

Write the value of this object to the specified output stream using the specified version format and return a reference to the modifiable stream. If version is not supported, stream is unmodified. Note that version is not written to stream. See the bslx package-level documentation for more information on bdex streaming of value-semantic types and containers.

◆ featureRequest() [1/2]

FeatureTestMessage & balb::Request::featureRequest ( )
inline

Return a reference to the modifiable "FeatureRequest" selection of this object if "FeatureRequest" is the current selection. The behavior is undefined unless "FeatureRequest" is the selection of this object.

◆ featureRequest() [2/2]

const FeatureTestMessage & balb::Request::featureRequest ( ) const
inline

Return a reference to the non-modifiable "FeatureRequest" selection of this object if "FeatureRequest" is the current selection. The behavior is undefined unless "FeatureRequest" is the selection of this object.

◆ isFeatureRequestValue()

bool balb::Request::isFeatureRequestValue ( ) const
inline

Return true if the value of this object is a "FeatureRequest" value, and return false otherwise.

◆ isSimpleRequestValue()

bool balb::Request::isSimpleRequestValue ( ) const
inline

Return true if the value of this object is a "SimpleRequest" value, and return false otherwise.

◆ isUndefinedValue()

bool balb::Request::isUndefinedValue ( ) const
inline

Return true if the value of this object is undefined, and false otherwise.

◆ lookupSelectionInfo() [1/2]

static const bdlat_SelectionInfo * balb::Request::lookupSelectionInfo ( const char *  name,
int  nameLength 
)
static

Return selection information for the selection indicated by the specified name of the specified nameLength if the selection exists, and 0 otherwise.

◆ lookupSelectionInfo() [2/2]

static const bdlat_SelectionInfo * balb::Request::lookupSelectionInfo ( int  id)
static

Return selection information for the selection indicated by the specified id if the selection exists, and 0 otherwise.

◆ makeFeatureRequest() [1/2]

FeatureTestMessage & balb::Request::makeFeatureRequest ( )

Set the value of this object to be a "FeatureRequest" value. Optionally specify the value of the "FeatureRequest". If value is not specified, the default "FeatureRequest" value is used.

◆ makeFeatureRequest() [2/2]

FeatureTestMessage & balb::Request::makeFeatureRequest ( const FeatureTestMessage value)

◆ makeSelection() [1/2]

int balb::Request::makeSelection ( const char *  name,
int  nameLength 
)

Set the value of this object to be the default for the selection indicated by the specified name of the specified nameLength. Return 0 on success, and non-zero value otherwise (i.e., the selection is not found).

◆ makeSelection() [2/2]

int balb::Request::makeSelection ( int  selectionId)

Set the value of this object to be the default for the selection indicated by the specified selectionId. Return 0 on success, and non-zero value otherwise (i.e., the selection is not found).

◆ makeSimpleRequest() [1/2]

SimpleRequest & balb::Request::makeSimpleRequest ( )

Set the value of this object to be a "SimpleRequest" value. Optionally specify the value of the "SimpleRequest". If value is not specified, the default "SimpleRequest" value is used.

◆ makeSimpleRequest() [2/2]

SimpleRequest & balb::Request::makeSimpleRequest ( const SimpleRequest value)

◆ manipulateSelection()

template<class MANIPULATOR >
int balb::Request::manipulateSelection ( MANIPULATOR &  manipulator)

Invoke the specified manipulator on the address of the modifiable selection, supplying manipulator with the corresponding selection information structure. Return the value returned from the invocation of manipulator if this object has a defined selection, and -1 otherwise.

◆ maxSupportedBdexVersion()

int balb::Request::maxSupportedBdexVersion ( )
inlinestatic

Return the most current bdex streaming version number supported by this class. See the bslx package-level documentation for more information on bdex streaming of value-semantic types and containers.

◆ operator=()

Request & balb::Request::operator= ( const Request rhs)

◆ print()

bsl::ostream & balb::Request::print ( bsl::ostream &  stream,
int  level = 0,
int  spacesPerLevel = 4 
) const

Format this object to the specified output stream at the optionally specified indentation level and return a reference to the modifiable stream. If level is specified, optionally specify spacesPerLevel, the number of spaces per indentation level for this and all of its nested objects. Each line is indented by the absolute value of level * spacesPerLevel. If level is negative, suppress indentation of the first line. If spacesPerLevel is negative, suppress line breaks and format the entire output on one line. If stream is initially invalid, this operation has no effect. Note that a trailing newline is provided in multiline mode only.

◆ reset()

void balb::Request::reset ( )

Reset this object to the default value (i.e., its value upon default construction).

◆ selectionId()

int balb::Request::selectionId ( ) const
inline

Return the id of the current selection if the selection is defined, and -1 otherwise.

◆ selectionName()

const char * balb::Request::selectionName ( ) const

◆ simpleRequest() [1/2]

SimpleRequest & balb::Request::simpleRequest ( )
inline

Return a reference to the modifiable "SimpleRequest" selection of this object if "SimpleRequest" is the current selection. The behavior is undefined unless "SimpleRequest" is the selection of this object.

◆ simpleRequest() [2/2]

const SimpleRequest & balb::Request::simpleRequest ( ) const
inline

Return a reference to the non-modifiable "SimpleRequest" selection of this object if "SimpleRequest" is the current selection. The behavior is undefined unless "SimpleRequest" is the selection of this object.

Member Data Documentation

◆ CLASS_NAME

const char balb::Request::CLASS_NAME[]
static

◆ d_featureRequest

bsls::ObjectBuffer< FeatureTestMessage > balb::Request::d_featureRequest

◆ d_simpleRequest

bsls::ObjectBuffer< SimpleRequest > balb::Request::d_simpleRequest

◆ SELECTION_INFO_ARRAY

const bdlat_SelectionInfo balb::Request::SELECTION_INFO_ARRAY[]
static

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