Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Function_map Class Reference

A map functions. More...

#include <maps.h>

Inheritance diagram for Function_map:
Collaboration diagram for Function_map:

Public Member Functions

int add_object (const std::string &n, Function *t)
 Insert a function into the table. More...
 

Public Attributes

std::vector< char > verbs
 Whether verbose is on. More...
 
std::vector< double > wtimes_self
 Accumulator of wall-clock time spent by itself excluding functions called by it. More...
 
std::vector< double > wtimes_tree
 Accumulator of wall-clock time spent by itself and those functions called by it. More...
 
std::vector< int > counts
 Counts of the number of calls. More...
 

Private Types

typedef Roccom_map< Function * > Base
 

Additional Inherited Members

- Protected Types inherited from Roccom_map< Function * >
typedef Functionvalue_type
 
- Protected Member Functions inherited from Roccom_map< Function * >
 Roccom_map ()
 
 ~Roccom_map ()
 
int add_object (std::string name, Function *t, bool is_const=false) throw (COM_exception)
 Insert an object into the table. More...
 
void remove_object (std::string name, bool is_const=false) throw (COM_exception)
 Remove an object from the table. More...
 
bool is_immutable (int i) const
 whether the object mutable More...
 
const Function *& operator[] (int i) const throw (COM_exception)
 Access an object using its handle. More...
 
Function *& operator[] (int i) throw (COM_exception)
 
const std::string & name (int i) const
 Name of the object. More...
 
int size () const
 
std::pair< int, Function ** > find (const std::string &name, bool is_const=false)
 
std::vector< std::string > get_names ()
 
- Protected Attributes inherited from Roccom_map< Function * >
I2O i2o
 Mapping from index to objects. More...
 
N2I n2i
 Mapping from names to indices. More...
 
std::list< int > salvaged
 List of salvaged indices. More...
 
std::vector< std::string > names
 Name of the objects. More...
 

Detailed Description

A map functions.

Supports quickly finding a function object from a function handle. Also contains timing information of functions to support profiling.

Definition at line 134 of file maps.h.

Member Typedef Documentation

typedef Roccom_map<Function*> Base
private

Definition at line 135 of file maps.h.

Member Function Documentation

int add_object ( const std::string &  n,
Function t 
)
inline

Insert a function into the table.

Definition at line 138 of file maps.h.

References Roccom_map< Object >::add_object(), counts, i, verbs, wtimes_self, and wtimes_tree.

138  {
139  unsigned int i = Roccom_map<Function*>::add_object( n, t);
140  if ( i+1>verbs.size()) {
141  verbs.resize(i+1, false);
142  wtimes_self.resize(i+1, 0.);
143  wtimes_tree.resize(i+1, 0.);
144  counts.resize(i+1, 0);
145  }
146  return i;
147  }
std::vector< char > verbs
Whether verbose is on.
Definition: maps.h:153
std::vector< double > wtimes_tree
Accumulator of wall-clock time spent by itself and those functions called by it.
Definition: maps.h:155
std::vector< double > wtimes_self
Accumulator of wall-clock time spent by itself excluding functions called by it.
Definition: maps.h:154
std::vector< int > counts
Counts of the number of calls.
Definition: maps.h:156
blockLoc i
Definition: read.cpp:79
const NT & n
int add_object(std::string name, Object t, bool is_const=false)
Insert an object into the table.
Definition: maps.h:97

Here is the call graph for this function:

Member Data Documentation

std::vector<int> counts

Counts of the number of calls.

Definition at line 156 of file maps.h.

Referenced by add_object(), Roccom_base::print_profile(), and Roccom_base::set_profiling().

std::vector<char> verbs

Whether verbose is on.

Definition at line 153 of file maps.h.

Referenced by add_object().

std::vector<double> wtimes_self

Accumulator of wall-clock time spent by itself excluding functions called by it.

Definition at line 154 of file maps.h.

Referenced by add_object(), Roccom_base::print_profile(), and Roccom_base::set_profiling().

std::vector<double> wtimes_tree

Accumulator of wall-clock time spent by itself and those functions called by it.

Definition at line 155 of file maps.h.

Referenced by add_object(), Roccom_base::print_profile(), and Roccom_base::set_profiling().


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