MetaCC::Template Class Reference

#include <metacc_compilation.h>

List of all members.


Detailed Description

Represent template declaration.

Definition at line 87 of file metacc_compilation.h.

Public Member Functions

 Template ()
 Default constructor (needed to allow storing Tempalte objects in std::map<>).
 Template (unsigned int n_bit_len)
 Construct template of specified bit length.
unsigned int get_bit_len () const
 Retrieve length of this template, in bits.
void add_substitute_text (std::string name, std::string substitute_word)
 Add yet another substitute text to the template under substitute named "name".
unsigned int get_substitute_names_count () const
 Return count of substitute names in this template.
std::string get_substitute_name (int name_index) const
 Return name under given index (index can be between 0 to get_substitute_names_count()-1).
bool is_substitute_name_exist (std::string name)
 Returns true if substitute of given name exist in the template, otherwise returns false.
unsigned int get_substitute_text_count (const std::string name)
 Return number of substitute text strings under given name.
std::string get_substitute_text (std::string name, unsigned int index)
 Return substitute text string under given name, and index.


Constructor & Destructor Documentation

MetaCC::Template::Template (  ) 

Default constructor (needed to allow storing Tempalte objects in std::map<>).

Definition at line 176 of file metacc_compilation.cpp.

MetaCC::Template::Template ( unsigned int  n_bit_len  ) 

Construct template of specified bit length.

Note:
after construction, user must fill the template with substitutes by repeatedly calling add_substitute() method.

Definition at line 180 of file metacc_compilation.cpp.


Member Function Documentation

unsigned int MetaCC::Template::get_bit_len (  )  const [inline]

Retrieve length of this template, in bits.

Definition at line 105 of file metacc_compilation.h.

void MetaCC::Template::add_substitute_text ( std::string  name,
std::string  substitute_word 
)

Add yet another substitute text to the template under substitute named "name".

Creates substitute named "name" if it doesn't exist.

Definition at line 185 of file metacc_compilation.cpp.

unsigned int MetaCC::Template::get_substitute_names_count (  )  const [inline]

Return count of substitute names in this template.

Definition at line 113 of file metacc_compilation.h.

std::string MetaCC::Template::get_substitute_name ( int  name_index  )  const [inline]

Return name under given index (index can be between 0 to get_substitute_names_count()-1).

Definition at line 116 of file metacc_compilation.h.

bool MetaCC::Template::is_substitute_name_exist ( std::string  name  ) 

Returns true if substitute of given name exist in the template, otherwise returns false.

Note:
ALWAYS use this function before calling to get_substitutes_count() or get_substitute_text() methods to verify the name is valid.

Definition at line 196 of file metacc_compilation.cpp.

unsigned int MetaCC::Template::get_substitute_text_count ( const std::string  name  ) 

Return number of substitute text strings under given name.

Note:
if substitute name doesn't exist the program will crash, so user MUST check for existence of the substitute using is_substitute_exist() before calling this method!

Definition at line 201 of file metacc_compilation.cpp.

std::string MetaCC::Template::get_substitute_text ( std::string  name,
unsigned int  index 
)

Return substitute text string under given name, and index.

Note:
Index must be in range 0 to get_substitutes_count() for the same name.

If substitute name doesn't exist the program will crash! So, the user MUST check for existence of the substitute using is_substitute_exist() before calling this method!

Definition at line 207 of file metacc_compilation.cpp.


The documentation for this class was generated from the following files:
Generated on Sat Sep 9 03:50:56 2006 for Openem APIs by  doxygen 1.4.7