const NameServer_ALLOWGROWTH |
|
Allow dynamic growth of the NameServer instance table
#define NameServer_ALLOWGROWTH (UInt)(~0)
DETAILS
This value can be used to set the
maxRuntimeEntries.
This flag tells NameServer to allow dynamic growth
of the table.
config NameServer_A_invArgument // module-wide |
|
Assert raised when an argument is invalid
extern const Assert_Id NameServer_A_invArgument;
config NameServer_A_invalidLen // module-wide |
|
Assert raised when the name or value is too long
extern const Assert_Id NameServer_A_invalidLen;
config NameServer_E_entryExists // module-wide |
|
Error raised when the name already exists in the instance
Name/Value table
extern const Error_Id NameServer_E_entryExists;
config NameServer_E_maxReached // module-wide |
|
Error raised if all the entries in the instance Name/Value table
are taken
extern const Error_Id NameServer_E_maxReached;
NameServer_isRegistered() // module-wide |
|
Determines if a remote driver is registered for the specified id
Bool NameServer_isRegistered(UInt16 procId);
ARGUMENTS
procId
The remote processor id.
NameServer_registerRemoteDriver() // module-wide |
|
Register the NameServer remote handle for the specified processor id
ARGUMENTS
handle
The handle for a NameServer remote driver instance.
procId
The remote processor id.
RETURNS
Returns
Status_SUCCESS if successful or
Status_FAIL if the processor id has already
been set.
DETAILS
This function is used by NameServer remote driver to register
themselves with NameServer. Only one remote driver can be registered
with a remote processor. The API returns
Status_FAIL if there
is already a registered remote driver for the processor id.
NameServer_unregisterRemoteDriver() // module-wide |
|
Unregister the NameServer remote handle for the specified processor id
Void NameServer_unregisterRemoteDriver(UInt16 procId);
ARGUMENTS
procId
The remote processor id to unregister.
DETAILS
This function is used by NameServer Remote implementations to unregister
themselves with NameServer.
Module-Wide Built-Ins |
|
// Get this module's unique id
Bool NameServer_Module_startupDone();
// Test if this module has completed startup
// The heap from which this module allocates memory
Bool NameServer_Module_hasMask();
// Test whether this module has a diagnostics mask
Bits16 NameServer_Module_getMask();
// Returns the diagnostics mask for this module
Void NameServer_Module_setMask(Bits16 mask);
// Set the diagnostics mask for this module
Instance Object Types |
|
typedef struct NameServer_Object NameServer_Object;
// Opaque internal representation of an instance object
// Client reference to an instance object
typedef struct NameServer_Struct NameServer_Struct;
// Opaque client structure large enough to hold an instance object
// Convert this instance structure pointer into an instance handle
// Convert this instance handle into an instance structure pointer
Instance Config Parameters |
|
typedef struct NameServer_Params {
// Instance config-params structure
// Common per-instance configs
Bool checkExisting;
// Check if a name already exists in the name/value table
UInt maxNameLen;
// Length, in MAUs, of the name field in the table
UInt maxRuntimeEntries;
// Maximum number of name/value pairs that can be dynamically created
UInt maxValueLen;
// Length, in MAUs, of the value field in the table
// Name/value table is allocated from this heap
} NameServer_Params;
// Initialize this config-params structure with supplier-specified defaults before instance creation
config NameServer_checkExisting // instance |
|
Check if a name already exists in the name/value table
DETAILS
When a name/value pair is added during runtime, if this boolean is true,
the table is searched to see if the name already exists. If it does,
the name is not added and the
E_entryExists error is raised.
If this flag is false, the table will not be checked to see if the name
already exists. It will simply be added. This mode has better
performance at the expense of potentially having non-unique names in the
table.
This flag is used for runtime adds only. Adding non-unique names during
configuration results in a build error.
config NameServer_maxNameLen // instance |
|
Length, in MAUs, of the name field in the table
DETAILS
The maximum length of the name portion of the name/value
pair. The length includes the null terminator ('\0').
config NameServer_maxRuntimeEntries // instance |
|
Maximum number of name/value pairs that can be dynamically created
...
UInt maxRuntimeEntries;
DETAILS
This parameter allows NameServer to pre-allocate memory.
When NameServer_add or NameServer_addUInt32 is called, no memory
allocation occurs.
If the number of pairs is not known at configuration time, set this
value to
ALLOWGROWTH. This instructs NameServer to grow the
table as needed. NameServer will allocate memory from the
tableHeap when a name/value pair is added.
The default is
ALLOWGROWTH.
config NameServer_maxValueLen // instance |
|
Length, in MAUs, of the value field in the table
DETAILS
Any value less than sizeof(UInt32) will be rounded up to sizeof(UInt32).
config NameServer_tableHeap // instance |
|
Name/value table is allocated from this heap
DETAILS
The instance table and related buffers are allocated out of this heap
during the dynamic create. This heap is also used to allocate new
name/value pairs when
ALLOWGROWTH for
maxRuntimeEntries
The default is to use the same heap that instances are allocated
from which can be configured via the
NameServer.common$.instanceHeap configuration parameter.
Instance Built-Ins |
|
Int NameServer_Object_count();
// The number of statically-created instance objects
// The handle of the i-th statically-created instance object (array == NULL)
// The handle of the first dynamically-created instance object, or NULL
// The handle of the next dynamically-created instance object, or NULL
// The heap used to allocate dynamically-created instance objects
// The label associated with this instance object
// The name of this instance object
proxy NameServer.SetupProxy |
|
NameServer setup proxy
// explicit access to the currently bound delegate module
NameServer.SetupProxy.abstractInstances$ = false
// use indirect runtime function calls if true
const NameServer.ALLOWGROWTH |
|
Allow dynamic growth of the NameServer instance table
const NameServer.ALLOWGROWTH = (~0);
DETAILS
This value can be used to set the
maxRuntimeEntries.
This flag tells NameServer to allow dynamic growth
of the table.
C SYNOPSIS
metaonly struct NameServer.Entry |
|
Structure of entry in Name/Value table
var obj = new NameServer.Entry;
obj.name = String ...
obj.len = UInt ...
obj.value = UArg ...
FIELDS
name
Name portion of the name/value pair.
len
Length of the value field.
value
Value portion of the name/value entry.
DETAILS
This structure is returned from the
getMeta
API.
config NameServer.A_invArgument // module-wide |
|
Assert raised when an argument is invalid
msg: "A_invArgument: Invalid argument supplied"
};
C SYNOPSIS
config NameServer.A_invalidLen // module-wide |
|
Assert raised when the name or value is too long
msg: "A_invalidLen: Invalid length"
};
C SYNOPSIS
config NameServer.E_entryExists // module-wide |
|
Error raised when the name already exists in the instance
Name/Value table
msg: "E_entryExists: %s name already in table "
};
C SYNOPSIS
config NameServer.E_maxReached // module-wide |
|
Error raised if all the entries in the instance Name/Value table
are taken
msg: "E_maxReached: All entries in use. NameServer.maxRuntimeEntries is %d"
};
C SYNOPSIS
metaonly config NameServer.common$ // module-wide |
|
Common module configuration parameters
DETAILS
All modules have this configuration parameter. Its name
contains the '$' character to ensure it does not conflict with
configuration parameters declared by the module. This allows
new configuration parameters to be added in the future without
any chance of breaking existing modules.
metaonly NameServer.modAddMeta() // module-wide |
|
Add a name/value pair into the specified instance's table during
configuration
NameServer.modAddMeta(String instName, String name, Any value, UInt len) returns Void
ARGUMENTS
instName
NameServer instance name
name
Name portion of the name/value pair
value
Value portion of the name/value pair
len
Length of the value buffer
DETAILS
This function adds any length value into the local table. The function
makes sure the name does not already exist in the local table.
This function should be used by modules when adding into a NameServer
instance. The application configuration file, should
use
addMeta.
The function does not query remote processors to make sure the
name is unique.
Instance Config Parameters |
|
var params = new NameServer.Params;
// Instance config-params object
params.checkExisting = Bool true;
// Check if a name already exists in the name/value table
params.maxNameLen = UInt 16;
// Length, in MAUs, of the name field in the table
// Maximum number of name/value pairs that can be dynamically created
params.maxValueLen = UInt 0;
// Length, in MAUs, of the value field in the table
// Name/value table is allocated from this heap
params.tableSection = String null;
// Name/value table is placed into this section on static creates
config NameServer.checkExisting // instance |
|
Check if a name already exists in the name/value table
var params = new NameServer.Params;
...
params.checkExisting = Bool true;
DETAILS
When a name/value pair is added during runtime, if this boolean is true,
the table is searched to see if the name already exists. If it does,
the name is not added and the
E_entryExists error is raised.
If this flag is false, the table will not be checked to see if the name
already exists. It will simply be added. This mode has better
performance at the expense of potentially having non-unique names in the
table.
This flag is used for runtime adds only. Adding non-unique names during
configuration results in a build error.
C SYNOPSIS
config NameServer.maxNameLen // instance |
|
Length, in MAUs, of the name field in the table
var params = new NameServer.Params;
...
params.maxNameLen = UInt 16;
DETAILS
The maximum length of the name portion of the name/value
pair. The length includes the null terminator ('\0').
C SYNOPSIS
config NameServer.maxRuntimeEntries // instance |
|
Maximum number of name/value pairs that can be dynamically created
var params = new NameServer.Params;
...
DETAILS
This parameter allows NameServer to pre-allocate memory.
When NameServer_add or NameServer_addUInt32 is called, no memory
allocation occurs.
If the number of pairs is not known at configuration time, set this
value to
ALLOWGROWTH. This instructs NameServer to grow the
table as needed. NameServer will allocate memory from the
tableHeap when a name/value pair is added.
The default is
ALLOWGROWTH.
C SYNOPSIS
config NameServer.maxValueLen // instance |
|
Length, in MAUs, of the value field in the table
var params = new NameServer.Params;
...
params.maxValueLen = UInt 0;
DETAILS
Any value less than sizeof(UInt32) will be rounded up to sizeof(UInt32).
C SYNOPSIS
config NameServer.tableHeap // instance |
|
Name/value table is allocated from this heap
var params = new NameServer.Params;
...
DETAILS
The instance table and related buffers are allocated out of this heap
during the dynamic create. This heap is also used to allocate new
name/value pairs when
ALLOWGROWTH for
maxRuntimeEntries
The default is to use the same heap that instances are allocated
from which can be configured via the
NameServer.common$.instanceHeap configuration parameter.
C SYNOPSIS
metaonly config NameServer.tableSection // instance |
|
Name/value table is placed into this section on static creates
var params = new NameServer.Params;
...
params.tableSection = String null;
DETAILS
The instance table and related buffers are placed into this section
during the static create.
The default is no explicit section placement.
metaonly NameServer.addMeta() // instance |
|
Add a name/value pair into the instance's table during configuration
inst.addMeta(String name, Any value, UInt len) returns Void
ARGUMENTS
name
Name portion of the name/value pair
value
Value portion of the name/value pair
len
Length of the value buffer
DETAILS
This function adds any length value into the local table. The function
makes sure the name does not already exist in the local table.
This function should be used by within the application configuration
file. XDC modules should use
modAddMeta.
The function does not query remote processors to make sure the
name is unique.
metaonly NameServer.addUInt32Meta() // instance |
|
Add a name/value pair into the instance's table during configuration
inst.addUInt32Meta(String name, Any value) returns Void
ARGUMENTS
name
Name portion of the name/value pair
value
Value portion of the name/value pair
DETAILS
This function adds a UInt32 value into the local table. The function
makes sure the name does not already exist in the local table.
The function does not query remote processors to make sure the
name is unique.
metaonly NameServer.getMeta() // instance |
|
Retrieves the name/value entry
ARGUMENTS
name
Name in question
RETURNS
Name/value entry
DETAILS
If the name is found, the entry is returned. The caller can parse the
entry as needed. If the name is not found, null is returned.
The search only occurs on the local table.