Apama  9.10.0.4.289795
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | List of all members
com::softwareag::connectivity::metadata_t Class Reference

A map class which implements many of the functions on std::map. More...

#include <sag_connectivity_cpp.hpp>

Inheritance diagram for com::softwareag::connectivity::metadata_t:
com::softwareag::connectivity::map_t

Classes

struct  _iterator
 Forward/reverse and const/non-const iterators are implemented using this class. More...
 

Public Member Functions

 metadata_t ()
 Construct an empty map. More...
 
 metadata_t (size_t n)
 Construct a map with (at least) capacity for n items. More...
 
 metadata_t (metadata_t &&other)
 Move constructor. Other will be left as the empty map. More...
 
metadata_toperator= (metadata_t &&other)
 Move assignment. More...
 
metadata_t copy () const
 Return a deep copy of this map. More...
 
bool operator== (const metadata_t &other) const
 Returns true if this map deep-equals other. More...
 
bool operator!= (const metadata_t &other) const
 Returns false if this map deep-equals other. More...
 
void swap (metadata_t &&other)
 Swap the contents of this map and other. More...
 
const char * operator[] (const char *k)
 Returns the item with the given key. More...
 
const char *const operator[] (const char *k) const
 Returns the item with the given key. More...
 
const char * operator[] (const std::string &k)
 Returns the item with the given key. More...
 
const char *const operator[] (const std::string &k) const
 Returns the item with the given key. More...
 
iterator find (const char *k)
 Searches the map for an item with the given key and returns an iterator to that position in the map. More...
 
const_iterator find (const char *k) const
 Searches the map for an item with the given key and returns an iterator to that position in the map. More...
 
iterator find (const std::string &k)
 Searches the map for an item with the given key and returns an iterator to that position in the map. More...
 
const_iterator find (const std::string &k) const
 Searches the map for an item with the given key and returns an iterator to that position in the map. More...
 
std::pair< iterator, bool > insert (const std::pair< std::string, std::string > &v)
 Insert a new key/value pair into the map. More...
 
std::pair< iterator, bool > insert (const std::pair< const char *, const char * > &v)
 Insert a new key/value pair into the map. More...
 
size_t erase (const std::string &k)
 Remove the item with the specified key. More...
 
size_t erase (const char *k)
 Remove the item with the specified key. More...
 
void erase (iterator it)
 Erase the item pointed to by this iterator. More...
 
iterator begin ()
 Forward iterator begin. More...
 
iterator end ()
 Forward iterator end. More...
 
const_iterator begin () const
 Forward const_iterator begin. More...
 
const_iterator end () const
 Forward const_iterator end. More...
 
const_iterator cbegin () const
 Forward const_iterator begin. More...
 
const_iterator cend () const
 Forward const_iterator end. More...
 

Additional Inherited Members

typedef _iterator< data_t,
sag_underlying_map_table_entry_t
*, pair< data_t > > 
iterator
 The type of iterators on mutable maps. More...
 
typedef _iterator< const
data_t,
sag_underlying_map_table_entry_t
const *, const pair< const
data_t > > 
const_iterator
 The type of iterators on const maps. More...
 
typedef pair< data_telement
 The type of an element in a mutable map. More...
 
typedef pair< const data_tconst_element
 The type of an element in a const map. More...
 
 map_t ()
 Construct an empty map. More...
 
 map_t (size_t n)
 Construct a map with (at least) capacity for n items. More...
 
 ~map_t ()
 Free the underlying map contents. More...
 
map_toperator= (map_t &&other)
 Move assignement. More...
 
 map_t (map_t &&other)
 Move constructor. Other will be left as the empty map. More...
 
void swap (map_t &&other)
 Swap the contents of this map and other. More...
 
map_t copy () const
 Return a deep copy of this map. More...
 
bool operator== (const map_t &other) const
 Returns true if this map deep-equals other. More...
 
bool operator!= (const map_t &other) const
 Returns false if this map deep-equals other. More...
 
iterator begin ()
 Forward iterator begin. More...
 
iterator end ()
 Forward iterator end. More...
 
const_iterator begin () const
 Forward const_iterator begin. More...
 
const_iterator end () const
 Forward const_iterator end. More...
 
const_iterator cbegin () const
 Forward const_iterator begin. More...
 
const_iterator cend () const
 Forward const_iterator end. More...
 
size_t size () const
 Returns the number of key/value pairs in the map. More...
 
bool empty () const
 Returns true if the map is empty (size() == 0) More...
 
data_toperator[] (const data_t &k)
 Return a reference to the item with the given key. More...
 
const data_toperator[] (const data_t &k) const
 Return a reference to the item with the given key. More...
 
iterator find (const data_t &k)
 Searches the map for an item with the given key and returns an iterator to that position in the map. More...
 
const_iterator find (const data_t &k) const
 Searches the map for an item with the given key and returns an iterator to that position in the map. More...
 
std::pair< iterator, bool > insert (const std::pair< data_t &&, data_t && > &v)
 Insert a new key/value pair into the map. More...
 
std::pair< iterator, bool > insert (data_t &&k, data_t &&v)
 Insert a new key/value pair into the map. More...
 
size_t erase (const data_t &k)
 Remove the item with the specified key. More...
 
void erase (iterator it)
 Erase the item pointed to by this iterator. More...
 
void clear ()
 Empty the map and free the underlying data. More...
 

Detailed Description

A map class which implements many of the functions on std::map.

This is an unordered map.

We don't guarantee exact method-for-method compatibility with any of the std types.

This class gives access methods to a map of const char*->const char*.

Keys starting with "sag." are reserved for internal use.

This is moveable, but not implicitly copyable. If you want to copy it use the .copy() method. If you want to move it use std::move().

No underlying implementation of the map is guaranteed. Modifying the contents will invalidate any iterators you have and any references that you have to the underlying structure.

Constructor & Destructor Documentation

com::softwareag::connectivity::metadata_t::metadata_t ( )
inline

Construct an empty map.

com::softwareag::connectivity::metadata_t::metadata_t ( size_t  n)
inlineexplicit

Construct a map with (at least) capacity for n items.

com::softwareag::connectivity::metadata_t::metadata_t ( metadata_t &&  other)
inline

Move constructor. Other will be left as the empty map.

Member Function Documentation

iterator com::softwareag::connectivity::metadata_t::begin ( )
inline

Forward iterator begin.

const_iterator com::softwareag::connectivity::metadata_t::begin ( ) const
inline

Forward const_iterator begin.

const_iterator com::softwareag::connectivity::metadata_t::cbegin ( ) const
inline

Forward const_iterator begin.

const_iterator com::softwareag::connectivity::metadata_t::cend ( ) const
inline

Forward const_iterator end.

metadata_t com::softwareag::connectivity::metadata_t::copy ( ) const

Return a deep copy of this map.

iterator com::softwareag::connectivity::metadata_t::end ( )
inline

Forward iterator end.

const_iterator com::softwareag::connectivity::metadata_t::end ( ) const
inline

Forward const_iterator end.

size_t com::softwareag::connectivity::metadata_t::erase ( const std::string &  k)
inline

Remove the item with the specified key.

Returns the number of items removed (always 1)

size_t com::softwareag::connectivity::metadata_t::erase ( const char *  k)
inline

Remove the item with the specified key.

Returns the number of items removed (always 1)

void com::softwareag::connectivity::metadata_t::erase ( iterator  it)
inline

Erase the item pointed to by this iterator.

If the iterator is end() this is a noop.

iterator com::softwareag::connectivity::metadata_t::find ( const char *  k)
inline

Searches the map for an item with the given key and returns an iterator to that position in the map.

If it is not found will return end().

const_iterator com::softwareag::connectivity::metadata_t::find ( const char *  k) const
inline

Searches the map for an item with the given key and returns an iterator to that position in the map.

If it is not found will return end().

iterator com::softwareag::connectivity::metadata_t::find ( const std::string &  k)
inline

Searches the map for an item with the given key and returns an iterator to that position in the map.

If it is not found will return end().

const_iterator com::softwareag::connectivity::metadata_t::find ( const std::string &  k) const
inline

Searches the map for an item with the given key and returns an iterator to that position in the map.

If it is not found will return end().

std::pair<iterator, bool> com::softwareag::connectivity::metadata_t::insert ( const std::pair< std::string, std::string > &  v)
inline

Insert a new key/value pair into the map.

If the key already exists then the map is not modified and an iterator to the existing item is returned. Returns pair<iterator, bool> where the iterator points to the item with the given key and the boolean is true if the map needed to be modified with the new pair.

std::pair<iterator, bool> com::softwareag::connectivity::metadata_t::insert ( const std::pair< const char *, const char * > &  v)
inline

Insert a new key/value pair into the map.

If the key already exists then the map is not modified and an iterator to the existing item is returned. Returns pair<iterator, bool> where the iterator points to the item with the given key and the boolean is true if the map needed to be modified with the new pair.

bool com::softwareag::connectivity::metadata_t::operator!= ( const metadata_t other) const
inline

Returns false if this map deep-equals other.

metadata_t& com::softwareag::connectivity::metadata_t::operator= ( metadata_t &&  other)
inline

Move assignment.

Other will be left as the empty map and our previous contents will be freed

bool com::softwareag::connectivity::metadata_t::operator== ( const metadata_t other) const
inline

Returns true if this map deep-equals other.

const char* com::softwareag::connectivity::metadata_t::operator[] ( const char *  k)
inline

Returns the item with the given key.

If k is not in the map then throws std::runtime_error This does not return a reference which can be assigned to

const char* const com::softwareag::connectivity::metadata_t::operator[] ( const char *  k) const
inline

Returns the item with the given key.

If k is not in the map then throws std::runtime_error

const char* com::softwareag::connectivity::metadata_t::operator[] ( const std::string &  k)
inline

Returns the item with the given key.

If k is not in the map then throws std::runtime_error This does not return a reference which can be assigned to

const char* const com::softwareag::connectivity::metadata_t::operator[] ( const std::string &  k) const
inline

Returns the item with the given key.

If k is not in the map then throws std::runtime_error

void com::softwareag::connectivity::metadata_t::swap ( metadata_t &&  other)
inline

Swap the contents of this map and other.


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