0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Private Attributes | List of all members
Hypertable::ClusterDefinitionFile::TranslatorRole Class Reference

Translates a role definition. More...

#include <TranslatorRole.h>

Inheritance diagram for Hypertable::ClusterDefinitionFile::TranslatorRole:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::ClusterDefinitionFile::TranslatorRole:
Collaboration graph
[legend]

Public Member Functions

 TranslatorRole (const string &fname, size_t lineno, const string &text)
 Constructor. More...
 
const string translate (TranslationContext &context) override
 Translates a role definition. More...
 

Private Attributes

string m_fname
 Source file name containing input text. More...
 
size_t m_lineno
 Starting offset within m_fname of input text. More...
 
string m_text
 Input text containing role definition statememt. More...
 

Detailed Description

Translates a role definition.

Definition at line 43 of file TranslatorRole.h.

Constructor & Destructor Documentation

Hypertable::ClusterDefinitionFile::TranslatorRole::TranslatorRole ( const string &  fname,
size_t  lineno,
const string &  text 
)
inline

Constructor.

Parameters
fnameFilename of source file
linenoStarting offset within source file of input text
textInput text

Definition at line 49 of file TranslatorRole.h.

Member Function Documentation

const string TranslatorRole::translate ( TranslationContext context)
overridevirtual

Translates a role definition.

This function translates role definitions of the form:

role: slave test[00-99]

To a bash variable definition of the form:

ROLE_slave="test[00-99]"

As a side effect, it inserts the role name into context.roles and inserts the variable name representing the role (e.g. ROLE_name) into the context.symbols map, mapping it to the role value (e.g. test[00-99] in the above example).

Parameters
contextContext object containing symbol tables
Returns
Translated role statement.

Implements Hypertable::ClusterDefinitionFile::Translator.

Definition at line 43 of file TranslatorRole.cc.

Member Data Documentation

string Hypertable::ClusterDefinitionFile::TranslatorRole::m_fname
private

Source file name containing input text.

Definition at line 72 of file TranslatorRole.h.

size_t Hypertable::ClusterDefinitionFile::TranslatorRole::m_lineno
private

Starting offset within m_fname of input text.

Definition at line 74 of file TranslatorRole.h.

string Hypertable::ClusterDefinitionFile::TranslatorRole::m_text
private

Input text containing role definition statememt.

Definition at line 76 of file TranslatorRole.h.


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