Belle II Software development
NSMVHandlerText Class Reference
Inheritance diagram for NSMVHandlerText:
NSMVHandler RCConfigHandler

Public Member Functions

 NSMVHandlerText (const std::string &name, bool useget, bool useset, const std::string &val="")
 
 NSMVHandlerText (const std::string &node, const std::string &name, bool useget, bool useset, const std::string &val="")
 
virtual bool handleGetText (std::string &val)
 
virtual bool handleSetText (const std::string &val)
 
const std::string & getNode () const
 
const std::string & getName () const
 
bool useGet () const
 
bool useSet () const
 
void setUseGet (bool use)
 
void setUseSet (bool use)
 
int getTimeStamp () const
 
int getId () const
 
void setNode (const std::string &node)
 
void setId (int id)
 
void set (const NSMVar &var)
 
void set (int val)
 
void set (float val)
 
void set (const std::string &val)
 
void set (const std::vector< int > &val)
 
void set (const std::vector< float > &val)
 
const NSMVarget () const
 
NSMVarget ()
 
NSMVar::Type getType () const
 
const char * getTypeLabel () const
 
bool isDumped () const
 
void setDumped (bool isdump)
 

Static Public Member Functions

static NSMVHandlercreate (const NSMVar &var)
 

Protected Attributes

int m_id
 
int m_timestamp
 
std::string m_node
 
std::string m_name
 
bool m_useget
 
bool m_useset
 
NSMVar m_var
 
bool m_isdump
 

Private Member Functions

bool handleGet (NSMVar &var) override
 
bool handleSet (const NSMVar &var) override
 

Detailed Description

Definition at line 158 of file NSMVHandler.h.

Constructor & Destructor Documentation

◆ NSMVHandlerText() [1/2]

NSMVHandlerText ( const std::string &  name,
bool  useget,
bool  useset,
const std::string &  val = "" 
)
inline

Definition at line 161 of file NSMVHandler.h.

163 : NSMVHandler("", name, useget, useset)
164 {
165 m_var = val;
166 }

◆ NSMVHandlerText() [2/2]

NSMVHandlerText ( const std::string &  node,
const std::string &  name,
bool  useget,
bool  useset,
const std::string &  val = "" 
)
inline

Definition at line 167 of file NSMVHandler.h.

169 : NSMVHandler(node, name, useget, useset)
170 {
171 m_var = val;
172 }

◆ ~NSMVHandlerText()

virtual ~NSMVHandlerText ( )
inlinevirtual

Definition at line 173 of file NSMVHandler.h.

173{}

Member Function Documentation

◆ create()

NSMVHandler * create ( const NSMVar var)
staticinherited

Definition at line 14 of file NSMVHandler.cc.

15{
16 const std::string node = var.getNode();
17 const std::string name = var.getName();
18 if (var.getType() == NSMVar::INT) {
19 if (var.getLength() == 0) {
20 return new NSMVHandlerInt(node, name, false, true);
21 }
22 return new NSMVHandlerIntArray(node, name, false, true);
23 } else if (var.getType() == NSMVar::FLOAT) {
24 if (var.getLength() == 0) {
25 return new NSMVHandlerFloat(node, name, false, true);
26 }
27 return new NSMVHandlerFloatArray(node, name, false, true);
28 } else if (var.getType() == NSMVar::TEXT) {
29 return new NSMVHandlerText(node, name, false, true);
30 }
31 return NULL;
32}

◆ get() [1/2]

NSMVar & get ( )
inlineinherited

Definition at line 68 of file NSMVHandler.h.

68{ return m_var; }

◆ get() [2/2]

const NSMVar & get ( ) const
inlineinherited

Definition at line 67 of file NSMVHandler.h.

67{ return m_var; }

◆ getId()

int getId ( ) const
inlineinherited

Definition at line 58 of file NSMVHandler.h.

58{ return m_id; }

◆ getName()

const std::string & getName ( ) const
inlineinherited

Definition at line 52 of file NSMVHandler.h.

52{ return m_name; }

◆ getNode()

const std::string & getNode ( ) const
inlineinherited

Definition at line 51 of file NSMVHandler.h.

51{ return m_node; }

◆ getTimeStamp()

int getTimeStamp ( ) const
inlineinherited

Definition at line 57 of file NSMVHandler.h.

57{ return m_timestamp; }

◆ getType()

NSMVar::Type getType ( ) const
inlineinherited

Definition at line 69 of file NSMVHandler.h.

69{ return m_var.getType(); }

◆ getTypeLabel()

const char * getTypeLabel ( ) const
inlineinherited

Definition at line 70 of file NSMVHandler.h.

70{ return m_var.getTypeLabel(); }

◆ handleGet()

bool handleGet ( NSMVar var)
overrideprivatevirtual

Reimplemented from NSMVHandler.

Definition at line 76 of file NSMVHandler.cc.

77{
78 std::string val;
79 if (handleGetText(val)) {
80 var = val;
81 return true;
82 }
83 return false;
84}

◆ handleGetText()

virtual bool handleGetText ( std::string &  val)
inlinevirtual

Definition at line 180 of file NSMVHandler.h.

181 {
182 val = m_var.getText();
183 return true;
184 }

◆ handleSet()

bool handleSet ( const NSMVar var)
overrideprivatevirtual

Reimplemented from NSMVHandler.

Definition at line 86 of file NSMVHandler.cc.

87{
88 if (var.getType() == NSMVar::TEXT && var.getLength() > 0) {
89 if (handleSetText(var.getText())) {
90 m_var = var.getText();
91 return true;
92 }
93 }
94 return false;
95}

◆ handleSetText()

virtual bool handleSetText ( const std::string &  val)
inlinevirtual

Definition at line 185 of file NSMVHandler.h.

186 {
187 m_var = val;
188 return true;
189 }

◆ isDumped()

bool isDumped ( ) const
inlineinherited

Definition at line 71 of file NSMVHandler.h.

71{ return m_isdump; }

◆ set() [1/6]

void set ( const NSMVar var)
inlineinherited

Definition at line 61 of file NSMVHandler.h.

61{ m_var = var; }

◆ set() [2/6]

void set ( const std::string &  val)
inlineinherited

Definition at line 64 of file NSMVHandler.h.

64{ m_var = val; }

◆ set() [3/6]

void set ( const std::vector< float > &  val)
inlineinherited

Definition at line 66 of file NSMVHandler.h.

66{ m_var = val; }

◆ set() [4/6]

void set ( const std::vector< int > &  val)
inlineinherited

Definition at line 65 of file NSMVHandler.h.

65{ m_var = val; }

◆ set() [5/6]

void set ( float  val)
inlineinherited

Definition at line 63 of file NSMVHandler.h.

63{ m_var = val; }

◆ set() [6/6]

void set ( int  val)
inlineinherited

Definition at line 62 of file NSMVHandler.h.

62{ m_var = val; }

◆ setDumped()

void setDumped ( bool  isdump)
inlineinherited

Definition at line 72 of file NSMVHandler.h.

72{ m_isdump = isdump; }

◆ setId()

void setId ( int  id)
inlineinherited

Definition at line 60 of file NSMVHandler.h.

60{ m_id = id; }

◆ setNode()

void setNode ( const std::string &  node)
inlineinherited

Definition at line 59 of file NSMVHandler.h.

59{ m_node = node; }

◆ setUseGet()

void setUseGet ( bool  use)
inlineinherited

Definition at line 55 of file NSMVHandler.h.

55{ m_useget = use; }

◆ setUseSet()

void setUseSet ( bool  use)
inlineinherited

Definition at line 56 of file NSMVHandler.h.

56{ m_useset = use; }

◆ useGet()

bool useGet ( ) const
inlineinherited

Definition at line 53 of file NSMVHandler.h.

53{ return m_useget; }

◆ useSet()

bool useSet ( ) const
inlineinherited

Definition at line 54 of file NSMVHandler.h.

54{ return m_useset; }

Member Data Documentation

◆ m_id

int m_id
protectedinherited

Definition at line 75 of file NSMVHandler.h.

◆ m_isdump

bool m_isdump
protectedinherited

Definition at line 82 of file NSMVHandler.h.

◆ m_name

std::string m_name
protectedinherited

Definition at line 78 of file NSMVHandler.h.

◆ m_node

std::string m_node
protectedinherited

Definition at line 77 of file NSMVHandler.h.

◆ m_timestamp

int m_timestamp
protectedinherited

Definition at line 76 of file NSMVHandler.h.

◆ m_useget

bool m_useget
protectedinherited

Definition at line 79 of file NSMVHandler.h.

◆ m_useset

bool m_useset
protectedinherited

Definition at line 80 of file NSMVHandler.h.

◆ m_var

NSMVar m_var
protectedinherited

Definition at line 81 of file NSMVHandler.h.


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