cgv
Loading...
Searching...
No Matches
variables.h
1
#pragma once
2
3
#include <string>
4
#include <vector>
5
#include "variant.h"
6
7
#include "lib_begin.h"
8
9
namespace
cgv
{
10
namespace
ppp {
11
19
struct
namespace_info
20
{
21
bool
is_function_call_ns;
22
variant::map_type* ns;
23
bool
ns_allocated;
24
namespace_info
* environment_ns;
25
namespace_info
* parent_ns;
26
namespace_info
* child_ns;
27
28
namespace_info
* get_environment() {
29
if
(is_function_call_ns)
30
return
environment_ns;
31
return
this
;
32
}
33
// construct from central information
34
namespace_info
(
bool
_is_function_call_ns, variant::map_type* _ns = 0,
namespace_info
* _environment_ns = 0,
namespace_info
* _parent_ns = 0);
35
// destruct variable map in case of function call namespaces
36
~namespace_info
();
37
};
38
40
extern
CGV_API
namespace_info
* get_current_namespace();
41
43
extern
CGV_API
void
set_current_namespace(
namespace_info
* _cns);
44
46
48
extern
CGV_API
variant
* find_variable(
const
std::string& name,
bool
only_current =
false
);
49
51
extern
CGV_API
variant
& ref_variable(
const
std::string& name,
bool
only_current =
false
);
52
54
extern
CGV_API
void
clear_variables();
55
57
extern
CGV_API
void
init_environment(
int
argc,
char
** argv);
58
60
extern
CGV_API
void
push_namespace(
variant
* ns_var,
namespace_info
* environment_ns = 0);
61
63
extern
CGV_API
void
pop_namespace();
64
66
extern
CGV_API
bool
has_child_namespace();
67
69
extern
CGV_API
void
goto_child_namespace();
70
72
extern
CGV_API
bool
has_parent_namespace();
73
75
extern
CGV_API
void
goto_parent_namespace();
76
77
}
78
}
79
#include <cgv/config/lib_end.h>
cgv::ppp::variant
Definition
variant.h:30
cgv
the cgv namespace
Definition
print.h:11
cgv::ppp::namespace_info
for each namespace the following information is stored
Definition
variables.h:20
cgv
ppp
variables.h
Generated by
1.9.8