Rosetta  2016.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Public Types | Public Member Functions | Private Attributes | List of all members
basic::datacache::DataMap Class Reference

general-purpose store for any reference-count derived object More...

#include <DataMap.hh>

Inheritance diagram for basic::datacache::DataMap:
Inheritance graph
[legend]

Public Types

typedef std::map< std::string,
std::map< std::string,
utility::pointer::ReferenceCountOP >
>::iterator 
iterator
 
typedef std::map< std::string,
std::map< std::string,
utility::pointer::ReferenceCountOP >
>::const_iterator 
const_iterator
 
- Public Types inherited from utility::pointer::ReferenceCount
typedef platform::Size Size
 
typedef platform::Size size_type
 

Public Member Functions

 DataMap ()
 
virtual ~DataMap ()
 
iterator begin ()
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
bool add (std::string const &type, std::string const &name, utility::pointer::ReferenceCountOP const op)
 
bool has (std::string const &type, std::string const &name="") const
 
template<class Ty >
Ty get (std::string const &type, std::string const &name) const
 
template<class Ty >
utility::pointer::shared_ptr< Ty > get_ptr (std::string const &type, std::string const &name) const
 
std::map< std::string,
utility::pointer::ReferenceCountOP > & 
operator[] (std::string const &type)
 
platform::Size size () const
 returns the size of the map (how many different types are in data_map_ More...
 
- Public Member Functions inherited from utility::pointer::ReferenceCount
 ReferenceCount ()
 Default constructor. More...
 
virtual ~ReferenceCount ()
 

Private Attributes

std::map< std::string,
std::map< std::string,
utility::pointer::ReferenceCountOP > > 
data_map_
 

Detailed Description

general-purpose store for any reference-count derived object

Member Typedef Documentation

typedef std::map< std::string, std::map< std::string, utility::pointer::ReferenceCountOP > >::iterator basic::datacache::DataMap::iterator

Constructor & Destructor Documentation

basic::datacache::DataMap::DataMap ( )
basic::datacache::DataMap::~DataMap ( )
virtual

Member Function Documentation

bool basic::datacache::DataMap::add ( std::string const &  type,
std::string const &  name,
utility::pointer::ReferenceCountOP const  op 
)
DataMap::iterator basic::datacache::DataMap::begin ( )

References data_map_.

DataMap::const_iterator basic::datacache::DataMap::begin ( ) const

References data_map_.

DataMap::iterator basic::datacache::DataMap::end ( )

References data_map_.

DataMap::const_iterator basic::datacache::DataMap::end ( ) const

References data_map_.

template<class Ty >
Ty basic::datacache::DataMap::get ( std::string const &  type,
std::string const &  name 
) const

a template utility function to grab any type of object from the Data_map. Downcasts the ReferenceCount object in map to the template data type using dynamic_cast to ensure type-correctness

Exceptions
Throwsa utility::excn::EXCN_Msg_Exception in the event that the requested object cannot be found in the DataMap.

References data_map_, and has().

Referenced by app.pyrosetta_toolkit.window_modules.interactive_terminal.interactive_terminal.TkConsoleView::getCurrentLine().

template<class Ty >
utility::pointer::shared_ptr< Ty > basic::datacache::DataMap::get_ptr ( std::string const &  type,
std::string const &  name 
) const

a template utility function to grab any type of object from the Data_map. Downcasts the owning pointer in map to the template data type using dynamic_pointer_cast to ensure type-correctness

Exceptions
Throwsa utility::excn::EXCN_Msg_Exception in the event that the requested object cannot be found in the DataMap.

References data_map_, and has().

Referenced by basic::datacache::HierarchicalDataMap::get(), and basic::datacache::get_set_from_datamap().

bool basic::datacache::DataMap::has ( std::string const &  type,
std::string const &  name = "" 
) const
std::map< std::string, utility::pointer::ReferenceCountOP > & basic::datacache::DataMap::operator[] ( std::string const &  type)

References add(), data_map_, and has().

platform::Size basic::datacache::DataMap::size ( ) const

returns the size of the map (how many different types are in data_map_

References data_map_.

Member Data Documentation

std::map< std::string, std::map< std::string, utility::pointer::ReferenceCountOP > > basic::datacache::DataMap::data_map_
private

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