Belle II Software development
NSMVHandlerInt Class Reference
Inheritance diagram for NSMVHandlerInt:
NSMVHandler

Public Member Functions

 NSMVHandlerInt (const std::string &name, bool useget, bool useset, int val=0)
 
 NSMVHandlerInt (const std::string &node, const std::string &name, bool useget, bool useset, int val=0)
 
bool handleGet (NSMVar &var) override
 
bool handleSet (const NSMVar &var) override
 
virtual bool handleGetInt (int &val)
 
virtual bool handleSetInt (int 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
 

Detailed Description

Definition at line 88 of file NSMVHandler.h.

Constructor & Destructor Documentation

◆ NSMVHandlerInt() [1/2]

NSMVHandlerInt ( const std::string &  name,
bool  useget,
bool  useset,
int  val = 0 
)
inline

Definition at line 91 of file NSMVHandler.h.

93 : NSMVHandler("", name, useget, useset)
94 {
95 m_var = val;
96 }

◆ NSMVHandlerInt() [2/2]

NSMVHandlerInt ( const std::string &  node,
const std::string &  name,
bool  useget,
bool  useset,
int  val = 0 
)
inline

Definition at line 97 of file NSMVHandler.h.

99 : NSMVHandler(node, name, useget, useset)
100 {
101 m_var = val;
102 }

◆ ~NSMVHandlerInt()

virtual ~NSMVHandlerInt ( )
inlinevirtual

Definition at line 103 of file NSMVHandler.h.

103{}

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)
overridevirtual

Reimplemented from NSMVHandler.

Definition at line 34 of file NSMVHandler.cc.

35{
36 int val;
37 if (handleGetInt(val)) {
38 var = val;
39 return true;
40 }
41 return false;
42}

◆ handleGetInt()

virtual bool handleGetInt ( int &  val)
inlinevirtual

Definition at line 110 of file NSMVHandler.h.

111 {
112 val = m_var.getInt();
113 return true;
114 }

◆ handleSet()

bool handleSet ( const NSMVar var)
overridevirtual

Reimplemented from NSMVHandler.

Definition at line 44 of file NSMVHandler.cc.

45{
46 if (var.getType() == NSMVar::INT&& var.getLength() == 0) {
47 if (handleSetInt(var.getInt())) {
48 m_var = var.getInt();
49 return true;
50 }
51 }
52 return false;
53}

◆ handleSetInt()

virtual bool handleSetInt ( int  val)
inlinevirtual

Definition at line 115 of file NSMVHandler.h.

116 {
117 m_var = val;
118 return true;
119 }

◆ 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: