ACT Library
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ValueIdx Class Reference

This class is used to create an instance in a scope. The name comes from the fact that this is used to keep track of the index of a value within a particular type (rather than a flat data structure, one per instance) and so is not defined as a value-per-instance, but rather a value-per-type. More...

#include <value.h>

Public Member Functions

bool hasConnection ()
 
bool hasAnyConnection ()
 
bool hasConnection (int i)
 
bool hasSubconnections ()
 
bool isPrimary ()
 
bool isPrimary (int i)
 
act_connectionconnection ()
 
const char * getName ()
 
act_attrgetAttr ()
 
act_attrgetAttrIdx (int i)
 
bool haveAttrIdx ()
 
int numAttrIdx ()
 

Public Attributes

InstTypet
 
struct act_attra
 instance attributes for the value
 
struct act_attr ** array_spec
 
unsigned int init:1
 
unsigned int immutable:1
 
ActNamespaceglobal
 
union {
   long   idx
 
   struct {
      act_connection *   c
 
      const char *   name
 
   }   obj
 
u
 the value associated with this instance
 

Detailed Description

This class is used to create an instance in a scope. The name comes from the fact that this is used to keep track of the index of a value within a particular type (rather than a flat data structure, one per instance) and so is not defined as a value-per-instance, but rather a value-per-type.

When a value is "allocated", it means it contains information about its value.

A value can also have a list of instance attributes associated with it. These are also held in this data structure.

Member Function Documentation

◆ connection()

act_connection * ValueIdx::connection ( )
inline

ONLY FOR NON-PARAM TYPES.

Returns
the connection pointer associated with this instance, NULL if none yet

◆ getAttr()

act_attr * ValueIdx::getAttr ( )
inline
Returns
the attributes associated with this instance

◆ getAttrIdx()

act_attr * ValueIdx::getAttrIdx ( int  i)
inline

For attributes associated with array instances

Parameters
iis the index into the array
Returns
the attributes associated with the sub-array at index i for this instance

◆ getName()

const char * ValueIdx::getName ( )
inline

ONLY FOR NON-PARAM TYPES.

Returns
the string name for the instance

◆ hasAnyConnection()

bool ValueIdx::hasAnyConnection ( )
inline

ONLY FOR NON-PARAM TYPES. Checks if there is any connection associated with this object

Returns
true if there is any connection/subconnection to this object, false otherwise

◆ hasConnection() [1/2]

bool ValueIdx::hasConnection ( )
inline

ONLY FOR NON-PARAM TYPES. For non-parameter types, this checks if there is a connection pointer associated with this object.

Returns
true if there is a connection pointer, false otherwise

◆ hasConnection() [2/2]

bool ValueIdx::hasConnection ( int  i)
inline

ONLY FOR NON-PARAM TYPES. Checks if there is a connection pointer associated with a sub-connection at index i for this object

Returns
true if there is a sub-connection at index i, false otherwise

◆ hasSubconnections()

bool ValueIdx::hasSubconnections ( )
inline

ONLY FOR NON-PARAM TYPES. Check if there are any sub-connections to this object

Returns
true if there are any sub-connections, false otherwise

◆ haveAttrIdx()

bool ValueIdx::haveAttrIdx ( )
inline

Check if there is an array-specific attribute specifier

Returns
true if an array specifier exists, false otherwise

◆ isPrimary() [1/2]

bool ValueIdx::isPrimary ( )
inline

ONLY FOR NON-PARAM TYPES. Check if this is a primary instance

Returns
true if this is the primary (canonical) instance, false otherwise

◆ isPrimary() [2/2]

bool ValueIdx::isPrimary ( int  i)
inline

ONLY FOR NON-PARAM TYPES. Check if the sub-connection at index i is the primary instance,

Returns
true if the i-th sub-connection is the primary instance, false otherwise.

◆ numAttrIdx()

int ValueIdx::numAttrIdx ( )
Returns
the number of indices that are valid for the attribute index check

Member Data Documentation

◆ a

struct act_attr* ValueIdx::a

instance attributes for the value

◆ array_spec

struct act_attr** ValueIdx::array_spec

array deref-specific attributes, if any

◆ c

act_connection* ValueIdx::c

For non-parameter types, the connection pointer. This is allocated in a lazy fashion.

◆ global

ActNamespace* ValueIdx::global

set for a namespace global; NULL otherwise. Note that global => immutable, but not the other way around

◆ idx

long ValueIdx::idx

Base index for allocated storage for parameterized types

◆ immutable

unsigned int ValueIdx::immutable

for parameter types: immutable if it is in a namespace or a template parameter

◆ init

unsigned int ValueIdx::init

Has this been allocated? 0 = no allocation, 1 = allocated

◆ name

const char* ValueIdx::name

the base name, from the hash table lookup: DO NOT FREE

◆ 

struct { ... } ValueIdx::obj

information about the object for non-paramter types

◆ t

InstType* ValueIdx::t

the type corresponding to this particular instance

◆ 

union { ... } ValueIdx::u

the value associated with this instance


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