BusBoy  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
BUSBOY::MetadataMap Class Reference

A map of names to arbitrary metadata elements. More...

#include <MetadataMap.h>

Inheritance diagram for BUSBOY::MetadataMap:
BUSBOY::MetadataElement

Public Member Functions

 MetadataMap ()
 
void putElement (const std::string &name, const CloneableMetadataElement &element)
 Assign an element to a name. More...
 
void putElement (const std::string &name, MetadataElement *element)
 Assign an element to a name. More...
 
MetadataElementgetElement (const std::string &name) const
 Returns a pointer to this object's internal copy of the element. More...
 
bool contains (const std::string &name) const
 
size_t getSize () const
 
std::set< std::string > getAllNames () const
 
MetadataElement::Type getMetadataElementType () const
 
bool operator== (const MetadataMap &map) const
 
bool operator== (const MetadataElement &element) const
 
bool operator!= (const MetadataMap &map) const
 
bool operator!= (const MetadataElement &element) const
 
 ~MetadataMap ()
 
- Public Member Functions inherited from BUSBOY::MetadataElement
template<typename T >
const T * castElement (const MetadataElement *element, Type type)
 
template<typename T >
T * castElement (MetadataElement *element, Type type)
 
template<typename T >
const T & castElement (const MetadataElement &element, Type type)
 
template<typename T >
T & castElement (MetadataElement &element, Type type)
 

Static Public Member Functions

static const MetadataMapcastToMap (const MetadataElement *element)
 
static MetadataMapcastToMap (MetadataElement *element)
 
static const MetadataMapcastToMap (const MetadataElement &element)
 
static MetadataMapcastToMap (MetadataElement &element)
 
- Static Public Member Functions inherited from BUSBOY::MetadataElement
static Type enumFromString (std::string strType)
 Parses the string equivalent of the enum. More...
 
static std::string enumToString (Type type)
 Returns the string equivalent of the enum. More...
 

Additional Inherited Members

- Public Types inherited from BUSBOY::MetadataElement
enum  Type {
  FIELD, ARRAY, LIST, MAP,
  KEY
}
 
- Static Protected Member Functions inherited from BUSBOY::MetadataElement
template<typename T >
static const T * castElement (const MetadataElement *element, Type type)
 
template<typename T >
static T * castElement (MetadataElement *element, Type type)
 
template<typename T >
static const T & castElement (const MetadataElement &element, Type type)
 
template<typename T >
static T & castElement (MetadataElement &element, Type type)
 

Detailed Description

A map of names to arbitrary metadata elements.

Constructor & Destructor Documentation

BUSBOY::MetadataMap::MetadataMap ( )
BUSBOY::MetadataMap::~MetadataMap ( )

Member Function Documentation

const MetadataMap * BUSBOY::MetadataMap::castToMap ( const MetadataElement element)
static
MetadataMap * BUSBOY::MetadataMap::castToMap ( MetadataElement element)
static
const MetadataMap & BUSBOY::MetadataMap::castToMap ( const MetadataElement element)
static
MetadataMap & BUSBOY::MetadataMap::castToMap ( MetadataElement element)
static
bool BUSBOY::MetadataMap::contains ( const std::string &  name) const
std::set< std::string > BUSBOY::MetadataMap::getAllNames ( ) const
MetadataElement * BUSBOY::MetadataMap::getElement ( const std::string &  name) const

Returns a pointer to this object's internal copy of the element.

MetadataElement::Type BUSBOY::MetadataMap::getMetadataElementType ( ) const
virtual
size_t BUSBOY::MetadataMap::getSize ( ) const
bool BUSBOY::MetadataMap::operator!= ( const MetadataMap map) const
bool BUSBOY::MetadataMap::operator!= ( const MetadataElement element) const
virtual
bool BUSBOY::MetadataMap::operator== ( const MetadataMap map) const
bool BUSBOY::MetadataMap::operator== ( const MetadataElement element) const
virtual
void BUSBOY::MetadataMap::putElement ( const std::string &  name,
const CloneableMetadataElement element 
)

Assign an element to a name.

This class makes its own copy of the element. The element may be disposed of after the call returns

void BUSBOY::MetadataMap::putElement ( const std::string &  name,
MetadataElement element 
)

Assign an element to a name.

The element must be allocated on the heap with new. This class takes ownership of the element and is responsible for deleting it.


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

Copyright 2014 Google Inc. All rights reserved.