Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
srcs
sbnana
sbnanalysis
ana
SBNOscReco
uScript
value.cc
Go to the documentation of this file.
1
#include <iostream>
2
3
#include "
value.h
"
4
5
void
uscript::Value::Print
()
const
{
6
switch
(
val
) {
7
case
uscript::VAL_BOOL
:
std::cout
<< (
AS_BOOL
(*
this
) ?
"true"
:
"false"
);
break
;
8
case
uscript::VAL_NIL
:
std::cout
<<
"nil"
;
break
;
9
case
uscript::VAL_NUMBER
:
std::cout
<<
AS_NUMBER
(*
this
);
break
;
10
case
uscript::VAL_INTEGER
:
std::cout
<<
AS_INTEGER
(*
this
);
break
;
11
case
uscript::VAL_OBJ_STRING
:
std::cout
<<
AS_CSTRING
(*
this
);
break
;
12
case
uscript::VAL_OBJ_TINSTANCE
:
std::cout
<<
"TInstance"
;
break
;
13
}
14
}
15
16
bool
uscript::Value::operator!
()
const
{
17
return
IS_NIL
(*
this
) || (
IS_INTEGER
(*
this
) &&
AS_INTEGER
(*
this
) == 0) || (
IS_BOOL
(*
this
) && !
AS_BOOL
(*
this
));
18
}
19
uscript::VAL_NUMBER
Definition:
value.h:12
IS_INTEGER
#define IS_INTEGER(value)
Definition:
value.h:62
uscript::VAL_NIL
Definition:
value.h:11
uscript::VAL_BOOL
Definition:
value.h:10
uscript::VAL_OBJ_TINSTANCE
Definition:
value.h:15
uscript::Value::operator!
bool operator!() const
Definition:
value.cc:16
AS_BOOL
#define AS_BOOL(value)
Definition:
value.h:52
AS_NUMBER
#define AS_NUMBER(value)
Definition:
value.h:53
AS_CSTRING
#define AS_CSTRING(value)
Definition:
value.h:56
IS_BOOL
#define IS_BOOL(value)
Definition:
value.h:60
uscript::Value::val
ValueType val
Definition:
value.h:30
IS_NIL
#define IS_NIL(value)
Definition:
value.h:59
AS_INTEGER
#define AS_INTEGER(value)
Definition:
value.h:54
uscript::Value::Print
void Print() const
Definition:
value.cc:5
uscript::VAL_OBJ_STRING
Definition:
value.h:14
value.h
cout
BEGIN_PROLOG could also be cout
Definition:
messageservice.fcl:10
uscript::VAL_INTEGER
Definition:
value.h:13
Generated by
1.8.5