The ActNamespace class holds all the information about a namespace.
More...
#include <namespaces.h>
The ActNamespace class holds all the information about a namespace.
◆ ActNamespace() [1/2]
ActNamespace::ActNamespace |
( |
const char * |
s | ) |
|
Create a new namespace in the global scope
- Parameters
-
s | is the name of the namespace |
◆ ActNamespace() [2/2]
ActNamespace::ActNamespace |
( |
ActNamespace * |
ns, |
|
|
const char * |
s |
|
) |
| |
Create a new namespace in the specified scope
- Parameters
-
s | is the name of the new namespace |
ns | is the parent namespace |
◆ ~ActNamespace()
ActNamespace::~ActNamespace |
( |
| ) |
|
◆ _init()
void ActNamespace::_init |
( |
ActNamespace * |
parent, |
|
|
const char * |
s |
|
) |
| |
|
private |
Internal initialization function shared by the two constructors
- Parameters
-
parent | is the parent namespace |
s | is the name of the new namespace |
◆ _subst_globals()
void ActNamespace::_subst_globals |
( |
list_t * |
subst, |
|
|
InstType * |
it, |
|
|
const char * |
s |
|
) |
| |
|
private |
Substitute globals within the namespace
- Parameters
-
subst | is used to return a list of user-defined types where the globals were substituted. |
it | is the type of the global |
s | is the name of the global |
◆ _subst_globals_addconn()
void ActNamespace::_subst_globals_addconn |
( |
list_t * |
subst, |
|
|
listitem_t * |
start, |
|
|
InstType * |
it, |
|
|
const char * |
s |
|
) |
| |
|
private |
◆ Act()
static class Act * ActNamespace::Act |
( |
| ) |
|
|
inlinestatic |
◆ AppendBody()
void ActNamespace::AppendBody |
( |
ActBody * |
b | ) |
|
Append to the current body
- Parameters
-
b | is the body to be appended |
◆ clrExported()
void ActNamespace::clrExported |
( |
| ) |
|
|
inline |
◆ CreateType()
int ActNamespace::CreateType |
( |
const char * |
s, |
|
|
UserDef * |
u |
|
) |
| |
Create a new user-defined type in this namespace
- Parameters
-
u | is a pointer to the userdefined type |
s | is the name of the type |
- Returns
- 1 if successful, 0 otherwise
◆ CurScope()
Scope * ActNamespace::CurScope |
( |
| ) |
|
|
inline |
Scope corresponding to this namespace
- Returns
- current scope
◆ EditType()
int ActNamespace::EditType |
( |
const char * |
s, |
|
|
UserDef * |
u |
|
) |
| |
Edit type: replace the type definition for the type name with the updated definition.
- Parameters
-
u | is the new type definition |
s | is the name of the type to be edited |
- Returns
- 1 if successful, 0 if the type name was not found.
◆ enum2Int()
void ActNamespace::enum2Int |
( |
| ) |
|
Convert any enum Data to an int
◆ Expand()
void ActNamespace::Expand |
( |
| ) |
|
◆ findInstance()
InstType * ActNamespace::findInstance |
( |
const char * |
s | ) |
|
Lookup instance name in the current namespace
- Returns
- instance pointer if found, NULL otherwise
◆ findName()
int ActNamespace::findName |
( |
const char * |
s | ) |
|
Lookup names.
- Returns
- 0 if unused name, 1 if it is already a type, and 2 if it is already a namespace, 3 if it is already an instance
◆ findNS()
Lookup namespaces in the current namespace scope
- Parameters
-
s | is the name of the namespace to be found |
- Returns
- namespace if found, NULL otherwise
◆ findType()
UserDef * ActNamespace::findType |
( |
const char * |
s | ) |
|
Lookup user-defined types in the current namespace
- Parameters
-
s | is the name of the type to be found |
- Returns
- Type * if found, NULL otherwise
◆ getBody()
ActBody * ActNamespace::getBody |
( |
| ) |
|
|
inline |
- Returns
- the current body of the namespace
◆ getChanList()
list_t * ActNamespace::getChanList |
( |
| ) |
|
- Returns
- a list of user-defined channel names
◆ getDataList()
list_t * ActNamespace::getDataList |
( |
| ) |
|
- Returns
- a list of user-defined data type names
◆ getlang()
- Returns
- the language bodies within this namespace
◆ getName()
const char * ActNamespace::getName |
( |
| ) |
|
|
inline |
Gets the name of the namespace
- Returns
- string corresponding to the namespace name
◆ getProcList()
list_t * ActNamespace::getProcList |
( |
| ) |
|
- Returns
- a list of process names
◆ getprs()
helper function to return the prs body
◆ getspec()
helper function to return the spec body
◆ getSubNamespaces()
list_t * ActNamespace::getSubNamespaces |
( |
| ) |
|
- Returns
- a list of char *'s of the names of the sub-namespaces nested within this one
◆ Global()
- Returns
- the global namespace
◆ Init()
static void ActNamespace::Init |
( |
| ) |
|
|
static |
Initialize the namespace module.
◆ isExpanded()
int ActNamespace::isExpanded |
( |
| ) |
|
|
inline |
Returns 1 if it is expanded
◆ isExported()
int ActNamespace::isExported |
( |
| ) |
|
|
inline |
Specifies if this is an exported namespace or not
- Returns
- 1 if this is an exported namespace, 0 otherwise
◆ Link()
void ActNamespace::Link |
( |
ActNamespace * |
up, |
|
|
const char * |
name |
|
) |
| |
Link namespace into parent
- Parameters
-
up | is the parent namespace |
name | is the name of the namespace |
◆ MkExported()
void ActNamespace::MkExported |
( |
| ) |
|
|
inline |
Set this to be an exported namespace
◆ Name()
char * ActNamespace::Name |
( |
bool |
add_colon = false | ) |
|
Returns a freshly allocated string containing the full path to the namespace; append "::" at the end if add_colon is true
◆ Parent()
Provides parent namespace
- Returns
- parent namespace
◆ Print()
void ActNamespace::Print |
( |
FILE * |
fp | ) |
|
Print text representation
◆ setAct()
static void ActNamespace::setAct |
( |
class Act * |
a | ) |
|
|
static |
◆ setBody()
void ActNamespace::setBody |
( |
ActBody * |
b | ) |
|
|
inline |
Replace the body with the one specified
- Parameters
-
◆ Unlink()
void ActNamespace::Unlink |
( |
| ) |
|
Unlink the namespace from its parent. This function is required for supporting namespace renaming
◆ Act
◆ ActNamespaceiter
◆ ActTypeiter
◆ act
class Act* ActNamespace::act |
|
staticprivate |
◆ creating_global
int ActNamespace::creating_global |
|
staticprivate |
used while creating the global namespace
◆ exported
unsigned int ActNamespace::exported |
|
private |
if this namespace is exported, set to 1; otherwise zero.
◆ global
pointer to the global namespace
hash table of all the instances within this namespace, encapsulated within the Scope
◆ lang
the sub-languages in the namespace
struct Hashtable* ActNamespace::N |
|
private |
hash table for namespaces nested within this one
◆ parent
if the namespace is nested, this is a pointer to the parent.
◆ self_bucket
hash_bucket_t* ActNamespace::self_bucket |
|
private |
hash table entry for this namespace
struct Hashtable* ActNamespace::T |
|
private |
hash table of all the types defined within this namespace When a type foo in the namespace is expanded to foo<x,y,z>, then the expanded version is also stored in this hash table.
The documentation for this class was generated from the following file: