ProviewR Programmer's Reference Manual  V6.1.4
Functions

Functions

pwr_tStatus gdh_ArefANameToAref (pwr_sAttrRef *arp, const char *aname, pwr_sAttrRef *oarp)
 Get the attribute reference for an attribute in an object attribute reference, where the attribute is specified by an string. More...
 
pwr_tStatus gdh_ArefDisabled (pwr_sAttrRef *arp, pwr_tDisableAttr *disabled)
 Check if an attribute is disabled. More...
 
pwr_tStatus gdh_AttrArefToObjectAref (pwr_sAttrRef *arp, pwr_sAttrRef *oarp)
 Get the attribute reference to an object or attribute object, from the attribute reference to an attribute in the object. More...
 
pwr_tStatus gdh_AttrrefToName (pwr_sAttrRef *attributeReference, char *nameBuffer, unsigned int sizeOfNameBuffer, pwr_tBitMask nameType)
 Translate an attribute referece to a name. More...
 
pwr_tStatus gdh_AttrRefToPointer (pwr_sAttrRef *arp, void **p)
 Gets the address of the data of an attribute reference. More...
 
pwr_tStatus gdh_AttrStringToValue (int type_id, char *value_str, void *buffer_ptr, int buff_size, int attr_size)
 Convert an attribute string to value. More...
 
pwr_tStatus gdh_AttrValueToString (pwr_eType type_id, pwr_tTid tid, void *value_ptr, char *str, int size, int *len, char *format)
 Convert a string to attribute value. More...
 
pwr_tStatus gdh_ClassAttrrefToAttr (pwr_tClassId classid, pwr_sAttrRef *attributeReference, char *nameBuffer, int sizeOfNameBuffer)
 Get the attribute name from a class and attrref. More...
 
pwr_tStatus gdh_ClassAttrToAttrref (pwr_tClassId classid, const char *attributeName, pwr_sAttrRef *attributeReference)
 Converts a class and attribute string to attrref format. More...
 
pwr_tStatus gdh_ClassNameToId (const char *className, pwr_tClassId *classid)
 Get the class identity corresponding to a class specified by name. More...
 
pwr_tStatus gdh_CreateObject (char *objectName, pwr_tClassId classid, unsigned int sizeOfObjectData, pwr_tObjid *objectId, pwr_tObjid internal1, pwr_tBitMask internal2, pwr_tObjid internal3)
 Create an object in a dynamic volume. More...
 
pwr_tStatus gdh_DeleteObject (pwr_tObjid objectId)
 Remove a local object. More...
 
pwr_tStatus gdh_DeleteObjectTree (pwr_tObjid objectId)
 Remove a local object tree. More...
 
pwr_tStatus gdh_DLRefObjectInfoAttrref (pwr_sAttrRef *addressOfAttributeReference, void **objectData, pwr_tDlid *directLinkId)
 Request a direct link to the data denoted by an attribute reference. More...
 
pwr_tStatus gdh_DLUnrefObjectInfo (pwr_tDlid directLinkId)
 Terminate direct linking of an object or an object attribute. More...
 
void gdh_DLUnrefObjectInfoAll (void)
 Removes all direct links set up by this process.
 
pwr_tStatus gdh_FReadObject (char *filename, pwr_tAttrRef *arp)
 Read a textfile into an object. More...
 
pwr_tStatus gdh_FWriteObject (char *filename, pwr_tAttrRef *arp)
 Write the content of an object to textfile. More...
 
pwr_tStatus gdh_GetAlarmInfo (pwr_tObjid object, pwr_tUInt32 *alarmLevel, pwr_tUInt32 *maxAlarmLevel, pwr_tUInt32 *alarmBlockLevel, pwr_tUInt32 *maxAlarmBlockLevel, pwr_tUInt32 *alarmVisibility)
 Get the alarm status for a certain object. More...
 
pwr_tStatus gdh_GetAttributeCharAttrref (pwr_sAttrRef *attributeReference, pwr_tTypeId *attributeType, unsigned int *attributeSize, unsigned int *attributeOffset, unsigned int *attributeDimension)
 Get the characteristics of an attribute. More...
 
pwr_tStatus gdh_GetAttributeFlags (pwr_sAttrRef *arp, unsigned int *flags)
 Get the flags of an attribute. More...
 
pwr_tStatus gdh_GetAttributeCharacteristics (char *name, pwr_tTypeId *tid, pwr_tUInt32 *size, pwr_tUInt32 *offs, pwr_tUInt32 *elem)
 Get the characteristics of an attribute, given its name and the class it belongs to. More...
 
pwr_tStatus gdh_GetAttrRefTid (pwr_sAttrRef *arp, pwr_tTid *tid)
 Get the type or class identifier of an attribute reference. More...
 
pwr_tStatus gdh_GetChild (pwr_tObjid object, pwr_tObjid *firstChild)
 Get the object identity of the first child of an object. More...
 
pwr_tStatus gdh_GetClassList (pwr_tClassId classid, pwr_tObjid *object)
 Get the object identity of the first object in the list of objects of a specified class. More...
 
pwr_tStatus gdh_GetClassListAttrRef (pwr_tClassId cid, pwr_sAttrRef *arp)
 Get the attribute reference of the first object in the list of objects of a specified class. The object can be a solitary object or an attribute object. More...
 
pwr_tStatus gdh_GetDynamicAttrSize (pwr_tObjid oid, char *name, pwr_tUInt32 *size)
 Get the size of a dynamic attribute. More...
 
pwr_tStatus gdh_GetEnumValueDef (pwr_tTid tid, gdh_sValueDef **vd, int *rows)
 Get definition information for an enumeration type. More...
 
pwr_tStatus gdh_GetLocalParent (pwr_tObjid object, pwr_tObjid *parent)
 Get the object identity of the local parent of an object. More...
 
pwr_tStatus gdh_GetMaskBitDef (pwr_tTid tid, gdh_sBitDef **bd, int *rows)
 Get definition information for a mask type. More...
 
pwr_tStatus gdh_GetNextAttrRef (pwr_tClassId cid, pwr_sAttrRef *arp, pwr_sAttrRef *new_arp)
 Get the attrref of the next object in the list of objects of a certain class. The object can be a solitary object or an attribute object. More...
 
pwr_tStatus gdh_GetNextObject (pwr_tObjid object, pwr_tObjid *nextObject)
 Get the object identity of the next object in the list of objects of a certain class. More...
 
pwr_tStatus gdh_GetNextObjectAttrRef (pwr_tClassId cid, pwr_sAttrRef *arp, pwr_sAttrRef *new_arp)
 Get the attrref of the next attribute object of a specified class in a specified object. More...
 
pwr_tStatus gdh_GetNextSibling (pwr_tObjid object, pwr_tObjid *nextSibling)
 Get the object identity of the next sibling (i.e. the next object with the same parent). More...
 
pwr_tStatus gdh_GetNextVolume (pwr_tVid pvid, pwr_tVid *vid)
 Get the next volume in the volume list. More...
 
pwr_tStatus gdh_GetNodeIndex (pwr_tNodeId *nodeIndex)
 Get the node identity of the local node. More...
 
pwr_tStatus gdh_GetNodeInfo (pwr_tNodeId nodidx, gdh_sNodeInfo *ip)
 Return info for a node identified by a node identifier (of type pwr_tNodeId). More...
 
pwr_tStatus gdh_GetNodeObject (pwr_tNodeId nodeIndex, pwr_tObjid *object)
 Return the objid of the node object for a node identified by a node identifier (of type pwr_tNodeId). More...
 
pwr_tStatus gdh_GetClassInfo (pwr_tCid cid, gdh_sClassInfo *info)
 Get class info. Returns information from $ClassDef object. More...
 
pwr_tStatus gdh_GetObjectClass (pwr_tObjid object, pwr_tClassId *classid)
 Get the class identifier of an object. More...
 
pwr_tStatus gdh_GetObjectClassList (pwr_tCid cid, pwr_tOid oid, pwr_sAttrRef *arp)
 Get the attribute reference of the first attribute object of a specified class in the specified object. More...
 
pwr_tStatus gdh_GetObjectDLCount (pwr_tObjid object, pwr_tUInt32 *count)
 Gets the direct link count of an object. More...
 
pwr_tStatus gdh_GetObjectInfo (const char *name, pwr_tAddress bufp, pwr_tUInt32 bufsize)
 Fetch data from an object or an attribute. More...
 
pwr_tStatus gdh_GetObjectInfoAttrref (pwr_sAttrRef *attributeReference, void *buffer, unsigned int sizeOfBuffer)
 Fetch the data of an attribute or a whole object body. More...
 
pwr_tStatus gdh_GetObjectLocation (pwr_tObjid object, pwr_tBoolean *isLocal)
 Return the location of an object. More...
 
pwr_tStatus gdh_GetObjectNodeIndex (pwr_tObjid object, pwr_tNodeId *nodeIndex)
 Get the node identity of the owner node of an object. More...
 
pwr_tStatus gdh_GetObjectSize (pwr_tObjid oid, pwr_tUInt32 *size)
 Get the size of the body of an object. More...
 
pwr_tStatus gdh_GetParent (pwr_tObjid object, pwr_tObjid *parent)
 Get the object identity of the parent of an object. More...
 
pwr_tStatus gdh_GetPreviousObject (pwr_tObjid object, pwr_tObjid *previousObject)
 Get the object identity of the previous object in the list of objects of a certain class. More...
 
pwr_tStatus gdh_GetPreviousSibling (pwr_tObjid object, pwr_tObjid *previousSibling)
 Get the object identity of the previous sibling (i.e. the previous object with the same parent). More...
 
pwr_tStatus gdh_GetRootList (pwr_tObjid *object)
 Get the first root object in the object tree. More...
 
pwr_tStatus gdh_GetSecurityInfo (pwr_sSecurity *security)
 Get security information. More...
 
pwr_tStatus gdh_GetVolumeInfo (pwr_tVid vid, gdh_sVolumeInfo *info)
 Get info for a volume. More...
 
pwr_tStatus gdh_GetVolumeList (pwr_tVid *vid)
 Get the first volume. More...
 
pwr_tStatus gdh_GetRootVolume (pwr_tVid *vid)
 Get info for a volume. More...
 
pwr_tStatus gdh_GetSubscriptionOldness (pwr_tSubid subid, pwr_tBoolean *isOld, pwr_tTime *lastUpdate, pwr_tStatus *lastStatus)
 Checks the oldness of a certain subscription. More...
 
pwr_tStatus gdh_GetSuperClass (pwr_tCid cid, pwr_tCid *supercid, pwr_tObjid oid)
 Get the superclass for a class. More...
 
pwr_tStatus gdh_Init (const char *name)
 Initialize the process to the Proview runtime environment. More...
 
pwr_tBoolean gdh_IsInitialized ()
 Check if gdh is initialized. Returns TRUE if gdh is initialized, else FALSE. More...
 
pwr_tStatus gdh_MountObjidToPointer (pwr_tObjid object, void **objectData)
 Get a pointer to a mount object. More...
 
pwr_tStatus gdh_MoveObject (pwr_tObjid objectId, pwr_tObjid newParentId)
 Move a local object. More...
 
pwr_tStatus gdh_NameToAttrref (pwr_tObjid parent, const char *attributeName, pwr_sAttrRef *attributeReference)
 Converts from name string to attribute reference. More...
 
pwr_tStatus gdh_NameToObjid (const char *objectName, pwr_tObjid *objid)
 Get the object identity of an object with name 'name'. More...
 
pwr_tStatus gdh_NameToPointer (const char *objectName, void **objectData)
 Get the address of the data of an object, given its name. More...
 
pwr_tStatus gdh_NethandlerRunning (void)
 Check if the Nethandler has started. More...
 
pwr_tStatus gdh_ObjidToName (pwr_tObjid oid, char *namebuf, pwr_tUInt32 size, pwr_tBitMask nametype)
 Get the name of an object identified by its object identity. More...
 
pwr_tStatus gdh_ObjidToPointer (pwr_tObjid object, void **objectData)
 Gets the address of the data of an object, given its object identity. More...
 
pwr_tStatus gdh_RefObjectInfo (char *attributeName, void **objectData, pwr_tSubid *subid, unsigned int sizeOfObjectData)
 The routine returns an address to the data that is denoted by Name. The name can be either an object or an object attribute. More...
 
pwr_tStatus gdh_RefObjectInfoList (unsigned int nEntry, gdh_sObjRef *objectReference, pwr_tSubid *subid)
 This routine returns addresses to the information that is denoted by "objref[].fullname". More...
 
pwr_tStatus gdh_RenameObject (pwr_tObjid objectId, char *newObjectName)
 Rename a local object. More...
 
pwr_tStatus gdh_SetAlarmBlockLevel (pwr_tObjid object, pwr_tUInt32 alarmBlockLevel)
 Sets the alarm block level for a certain object. More...
 
pwr_tStatus gdh_SetAlarmLevel (pwr_tObjid object, pwr_tUInt32 alarmLevel)
 This routine sets the alarm level for a certain object. More...
 
pwr_tStatus gdh_SetObjectInfo (const char *attributeName, void *buffer, unsigned int sizeOfBuffer)
 Change the value of an attribute or the whole body of an object. More...
 
pwr_tStatus gdh_SetObjectInfoAttrref (pwr_sAttrRef *attributeReference, void *buffer, unsigned int sizeOfBuffer)
 Change the data of an object or an attribute. More...
 
pwr_tStatus gdh_SubAssociateBuffer (pwr_tSubid subid, void **buffer, unsigned int sizeOfBuffer)
 Associate a buffer with the subscription. More...
 
pwr_tStatus gdh_SubData (pwr_tSubid subid, void *buffer, unsigned int sizeOfBuffer)
 Fetch the data associated with a subscription. More...
 
pwr_tStatus gdh_SubRefObjectInfoAttrref (pwr_sAttrRef *attributeReference, pwr_tSubid *subid)
 This routine returns a subid to the information that is denoted by 'aref'. The name can be either an object or an object attribute. More...
 
pwr_tStatus gdh_SubRefObjectInfoList (unsigned int entryCount, void *object[], pwr_tBoolean isAttrref[], pwr_tSubid subid[])
 Sets up a list of subscriptions to an object/attribute. More...
 
pwr_tStatus gdh_SubRefObjectInfoName (char *attributeName, pwr_tSubid *subid)
 Get the address of the data that is denoted by 'name'. More...
 
pwr_tStatus gdh_SubSize (pwr_tSubid subid, unsigned int *size)
 Fetch the data size associated with a subscription. More...
 
pwr_tStatus gdh_SetSubscriptionDefaults (pwr_tInt32 defaultUpdateTime, pwr_tInt32 defaultTimeOut)
 Sets default subscription timers for future subscription requests. More...
 
pwr_tStatus gdh_SubUnrefObjectInfo (pwr_tSubid subid)
 Terminates subscription of an object or an attribute. More...
 
void gdh_SubUnrefObjectInfoAll (void)
 Terminates all subscriptions set up by this user (job/process).
 
pwr_tStatus gdh_SubUnrefObjectInfoList (unsigned int nEntry, pwr_tSubid *subid)
 Terminates a list of subscriptions. More...
 
pwr_tStatus gdh_UnrefObjectInfo (pwr_tSubid subid)
 Terminates the subscription defined by the subscription identity. More...
 
pwr_tStatus gdh_UnrefObjectInfoAll (void)
 Terminates all subscriptions set up by this process. More...
 
pwr_tStatus gdh_VolumeIdToName (pwr_tVid vid, char *name, int size)
 Get the name for a volume denoted by volume identity. More...
 
void gdh_StoreRtdbPointer (unsigned long *rtdbReference, void *virtualAddress)
 Convert pointer to rtdb relative pointer.
 
void * gdh_TranslateRtdbPointer (unsigned long rtdbReference)
 Convert rtdb relative pointer to absolute pointer. More...
 
void gdh_GetTimeDL (pwr_tTime *atp, pwr_tTime *time)
 Thread save function to fetch a direct linked absolute time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
void gdh_SetTimeDL (pwr_tTime *atp, pwr_tTime *time)
 Thread save function to store a direct linked absolute time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
void gdh_GetDeltaTimeDL (pwr_tDeltaTime *dtp, pwr_tDeltaTime *time)
 Thread save function to fetch a direct linked delta time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
void gdh_SetDeltaTimeDL (pwr_tDeltaTime *dtp, pwr_tDeltaTime *time)
 Thread save function to store a direct linked delta time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
void gdh_GetStrDL (char *sp, char *str, int size)
 Thread save function to fetch a direct linked string value. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More...
 
void gdh_SetStrDL (char *sp, const char *str, int size)
 Thread save function to store a direct linked string value. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More...
 
pwr_tStatus gdh_GetObjectInfoTime (const char *name, pwr_tTime *time)
 Fetch an absolute time value from an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
pwr_tStatus gdh_SetObjectInfoTime (const char *name, pwr_tTime *time)
 Store an absolute time value in an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
pwr_tStatus gdh_GetObjectInfoDeltaTime (const char *name, pwr_tDeltaTime *time)
 Fetch an delta time value from an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
pwr_tStatus gdh_SetObjectInfoDeltaTime (const char *name, pwr_tDeltaTime *time)
 Store a delta time value in an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time). More...
 
pwr_tStatus gdh_GetObjectInfoStr (const char *name, char *str, int size)
 Fetch a string value from an attribute. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More...
 
pwr_tStatus gdh_SetObjectInfoStr (const char *name, const char *str, int size)
 Store a string value in an attribute. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str). More...
 

Detailed Description

Function Documentation

◆ gdh_ArefANameToAref()

pwr_tStatus gdh_ArefANameToAref ( pwr_sAttrRef arp,
const char *  aname,
pwr_sAttrRef oarp 
)

Get the attribute reference for an attribute in an object attribute reference, where the attribute is specified by an string.

Returns
pwr_tStatus
Parameters
arpPointer to object attribute reference
anameAttribute name string
oarpReceives the attribute reference.

Definition at line 192 of file rt_gdh.c.

Referenced by gdh_FReadObject().

◆ gdh_ArefDisabled()

pwr_tStatus gdh_ArefDisabled ( pwr_sAttrRef arp,
pwr_tDisableAttr disabled 
)

Check if an attribute is disabled.

Returns
pwr_tStatus
Parameters
arpAttribute reference
disabledRecives 1 if disabled else 0

Definition at line 4283 of file rt_gdh.c.

◆ gdh_AttrArefToObjectAref()

pwr_tStatus gdh_AttrArefToObjectAref ( pwr_sAttrRef arp,
pwr_sAttrRef oarp 
)

Get the attribute reference to an object or attribute object, from the attribute reference to an attribute in the object.

This functions cuts the last attribute segment.

Returns
pwr_tStatus
Parameters
arpAttribute reference to the attribute.
oarpReturned attribute reference to the object or attribute object.

Definition at line 257 of file rt_gdh.c.

References pwr_mAttrRef::b, and pwr_sAttrRef::Flags.

◆ gdh_AttrrefToName()

pwr_tStatus gdh_AttrrefToName ( pwr_sAttrRef arp,
char *  name,
unsigned int  size,
pwr_tBitMask  nametype 
)

Translate an attribute referece to a name.

Returns
pwr_tStatus
Parameters
arpPointer to the attribute reference.
nameName buffer supplied by the user, where name is written.
sizeSize of the name buffer
nametypeMask of type cdh_mName.

Definition at line 128 of file rt_gdh.c.

References pwr_mAttrRef::b, pwr_sAttrRef::Flags, gdh_ObjidToName(), and pwr_sAttrRef::Objid.

◆ gdh_AttrRefToPointer()

pwr_tStatus gdh_AttrRefToPointer ( pwr_sAttrRef arp,
void **  p 
)

Gets the address of the data of an attribute reference.

Nota bene ! Only local objects can be referenced.

Returns
pwr_tStatus
Parameters
arpAttribute reference.
pReveives a pointer to the object.

Definition at line 2493 of file rt_gdh.c.

Referenced by gdh_FReadObject().

◆ gdh_AttrStringToValue()

pwr_tStatus gdh_AttrStringToValue ( int  type_id,
char *  value_str,
void *  buffer_ptr,
int  buff_size,
int  attr_size 
)

Convert an attribute string to value.

Parameters
type_idAttribute type
value_strString value
buffer_ptrValue buffer
buff_sizeSize of value buffer
attr_sizeAttribute size, used for String and Text attributes

Definition at line 4879 of file rt_gdh.c.

Referenced by gdh_FReadObject().

◆ gdh_AttrValueToString()

pwr_tStatus gdh_AttrValueToString ( pwr_eType  type_id,
pwr_tTid  tid,
void *  value_ptr,
char *  str,
int  size,
int *  len,
char *  format 
)

Convert a string to attribute value.

Parameters
type_idAttribute type
tidAttribute type identity
value_ptrPointer to attribute value
strString buffer
sizeSize of string buffer
lenReceives the string length
formatFormat for conversion in printf syntax

Definition at line 4549 of file rt_gdh.c.

◆ gdh_ClassAttrrefToAttr()

pwr_tStatus gdh_ClassAttrrefToAttr ( pwr_tClassId  cid,
pwr_sAttrRef arp,
char *  name,
int  size 
)

Get the attribute name from a class and attrref.

The objid of the attrref is not used.

Returns
Status of the operation.
Parameters
cidThe class identity whose attribute we want to examin
arpAttribute description.
nameThe returned name of the attribute
sizeMax size of the returned name

Definition at line 369 of file rt_gdh.c.

◆ gdh_ClassAttrToAttrref()

pwr_tStatus gdh_ClassAttrToAttrref ( pwr_tClassId  cid,
const char *  name,
pwr_sAttrRef arp 
)

Converts a class and attribute string to attrref format.

The Objid of the attrref is left untouched.

Returns
pwr_tStatus
Parameters
cidThe class identity whose attribute we want to examin
nameThe name of the attribute we want
arpReceives the attribute description.

Definition at line 319 of file rt_gdh.c.

◆ gdh_ClassNameToId()

pwr_tStatus gdh_ClassNameToId ( const char *  name,
pwr_tClassId cid 
)

Get the class identity corresponding to a class specified by name.

Returns
pwr_tStatus
Parameters
nameClass name string.
cidReturned class identity.

Definition at line 413 of file rt_gdh.c.

◆ gdh_CreateObject()

pwr_tStatus gdh_CreateObject ( char *  name,
pwr_tClassId  cid,
unsigned int  size,
pwr_tObjid oid,
pwr_tObjid  req_oid,
pwr_tBitMask  flags,
pwr_tObjid  soid 
)

Create an object in a dynamic volume.

Objects can only be created in local dynamic volumes, or in the local system volume.
Space is allocated for the object which must not exist. This call is possible only if the object is created in a local volume, i.e a volume owned by the local node.

All reachable nodes, who have mounted the volume in question, are notified about this new object. It is possible to require a certain objid, but the the objid must not exist in the requested volume.

If the volume identity part of the required objid (objid.vid) is zero the the volume id indicated by the given name is used. If the objid.vid != zero, then it must match the volume id indicated by the name.

Returns
pwr_tStatus
Parameters
nameObject name string with path.
cidClass id for object.
sizeSize of object body. Only needed for objects with dynamic size, else 0.
oidReturned objid.
req_oidRequested objid. Only if any special objid is prefered, else pwr_cNOid.
flagsAlias client or mount client.
soidServer objid. Used for ExternVolumes. Normally pwr_cNOid

Definition at line 455 of file rt_gdh.c.

◆ gdh_DeleteObject()

pwr_tStatus gdh_DeleteObject ( pwr_tObjid  oid)

Remove a local object.

Object header and the associated body are removed. This call is possible only if the object is in a local volume, i.e a volume owned by the local node. The volume must be of class $DynamicVolume or $SystemVolume. The object must not be parent to any other object.

All reachable nodes, who have mounted the volume in question, are notified about the removal of this object.

The object is not completly removed until all directlink and subscriptions to the object are removed.

Returns
pwr_tStatus
Parameters
oidThe identity of the object to delete.

Definition at line 513 of file rt_gdh.c.

References cdh_ObjidIsNull().

Referenced by nmpsappl_RemoveAndDeleteData().

◆ gdh_DeleteObjectTree()

pwr_tStatus gdh_DeleteObjectTree ( pwr_tObjid  oid)

Remove a local object tree.

Object header and the associated body are removed. This call is possible only if the object is in a local volume, i.e a volume owned by the local node. The volume must be of class $DynamicVolume or $SystemVolume. The object must not be parent to any other object.

All reachable nodes, who have mounted the volume in question, are notified about the removal of this object.

The objects is not completly removed until all directlink and subscriptions to the object are removed.

Returns
pwr_tStatus
Parameters
oidThe identity of the root object of the tree.

Definition at line 548 of file rt_gdh.c.

References cdh_ObjidIsNull().

◆ gdh_DLRefObjectInfoAttrref()

pwr_tStatus gdh_DLRefObjectInfoAttrref ( pwr_sAttrRef arp,
void **  infop,
pwr_tDlid dlid 
)

Request a direct link to the data denoted by an attribute reference.

The object owning the data must be owned by the local node. The caller receives a pointer to data in the object body in the realtime database. The data can be changed by the user without restriction.

The data should be unlinked with a gdh_DLUnrefObjectInfo() call.

Returns
pwr_tStatus
Parameters
arpPointer to attribute reference for object or attribute to link to.
infopReturnd pointer to the data.
dlidId for the direct link. Used to unlink the data.

Definition at line 578 of file rt_gdh.c.

◆ gdh_DLUnrefObjectInfo()

pwr_tStatus gdh_DLUnrefObjectInfo ( pwr_tDlid  dlid)

Terminate direct linking of an object or an object attribute.

The pointer returned by DLRefObjectInfo can become invalid after this call.

See also
gdh_DLRefObjectInfo
gdh_DLRefObjectInfoAttrref
Returns
pwr_tStatus
Parameters
dlid<The id of the direct link we want to remove

Definition at line 637 of file rt_gdh.c.

◆ gdh_FReadObject()

pwr_tStatus gdh_FReadObject ( char *  filename,
pwr_tAttrRef arp 
)

Read a textfile into an object.

Reads a textfile, created by gdh_FWriteObject, and inserts the values into the specified object.

The file has to be generated from the same object or from an object of the same class.

See also
gdh_FWriteObject
Returns
pwr_tStatus
Parameters
filenameFile specification
arpAttribute reference for object

Definition at line 4459 of file rt_gdh.c.

References cdh_tidIsCid, EVEN, gdh_ArefANameToAref(), gdh_AttrRefToPointer(), gdh_AttrStringToValue(), gdh_GetAttributeCharAttrref(), gdh_GetAttrRefTid(), and gdh_SetObjectInfoAttrref().

◆ gdh_FWriteObject()

pwr_tStatus gdh_FWriteObject ( char *  filename,
pwr_tAttrRef arp 
)

Write the content of an object to textfile.

The file can later be read and the attribute values inserted in the object or in another object of the same class with the function gdh_FReadObject.

See also
gdh_FReadObject
Returns
pwr_tStatus
Parameters
filenameFile specification
arpAttribute reference to object

Definition at line 4404 of file rt_gdh.c.

References pwr_mAttrRef::b, cdh_tidIsCid, EVEN, pwr_sAttrRef::Flags, gdh_GetAttrRefTid(), gdh_GetObjectInfoAttrref(), gdh_GetObjectSize(), pwr_sAttrRef::Objid, and pwr_sAttrRef::Size.

◆ gdh_GetAlarmInfo()

pwr_tStatus gdh_GetAlarmInfo ( pwr_tObjid  oid,
pwr_tUInt32 a,
pwr_tUInt32 maxa,
pwr_tUInt32 b,
pwr_tUInt32 maxb,
pwr_tUInt32 alarmvisibility 
)

Get the alarm status for a certain object.

Returns
pwr_tStatus
Parameters
oidObject identity
aReceives the alarm status. Can be NULL
maxaReceives the highest alarm level of the object. Can be NULL
bReceives the blocking level of the object. CAn be NULL
maxbReceives the highest existing blocking level of the object. Can be NULL
alarmvisibilityReceives the alarm block level.

Definition at line 670 of file rt_gdh.c.

◆ gdh_GetAttributeCharacteristics()

pwr_tStatus gdh_GetAttributeCharacteristics ( char *  name,
pwr_tTypeId tid,
pwr_tUInt32 size,
pwr_tUInt32 offs,
pwr_tUInt32 elem 
)

Get the characteristics of an attribute, given its name and the class it belongs to.

The output arguments can have an actual value of NULL if they are not wanted.

Returns
pwr_tStatus
Parameters
nameString containing attribute name; object.attribute or object.attribute[index].
tidAddress to an integer where the type is stored.
sizeAddress to an integer where the size is stored.
offsAddress to an integer where the offset is stored.
elemAddress to an integer where the # of elements is stored.

Definition at line 1892 of file rt_gdh.c.

◆ gdh_GetAttributeCharAttrref()

pwr_tStatus gdh_GetAttributeCharAttrref ( pwr_sAttrRef arp,
pwr_tTypeId tid,
unsigned int *  size,
unsigned int *  offs,
unsigned int *  elem 
)

Get the characteristics of an attribute.

The output arguments can be NULL if they are not wanted.

Returns
pwr_tStatus
Parameters
arpThe attribute of which to fetch the charactertistics.
tidReceives the attribute type.
sizeReceives the size in bytes
offsReceives the offset of the attribute from the beginning of the object .
elemReceives the number of elements.

Definition at line 1949 of file rt_gdh.c.

Referenced by gdh_FReadObject().

◆ gdh_GetAttributeFlags()

pwr_tStatus gdh_GetAttributeFlags ( pwr_sAttrRef arp,
unsigned int *  flags 
)

Get the flags of an attribute.

Returns
pwr_tStatus
Parameters
arpThe attribute of which to fetch flags.
flagsReceives the attribute flags.

Definition at line 1994 of file rt_gdh.c.

◆ gdh_GetAttrRefTid()

pwr_tStatus gdh_GetAttrRefTid ( pwr_sAttrRef arp,
pwr_tTid tid 
)

Get the type or class identifier of an attribute reference.

Returns
pwr_tStatus
Parameters
arpThe attribute reference.
tidReceives the aref type or class identity.

Definition at line 1145 of file rt_gdh.c.

References pwr_mAttrRef::b, pwr_sAttrRef::Body, pwr_sAttrRef::Flags, gdh_GetObjectClass(), pwr_sAttrRef::Objid, pwr_sAttrRef::Offset, and pwr_sAttrRef::Size.

Referenced by gdh_FReadObject(), and gdh_FWriteObject().

◆ gdh_GetChild()

pwr_tStatus gdh_GetChild ( pwr_tObjid  oid,
pwr_tObjid new_oid 
)

Get the object identity of the first child of an object.

Other children are fetched with gdh_GetNextSibling.

See also
gdh_GetNextSibling

Example

pwr_tOid coid;
// Get all children to oid
for ( sts = gdh_GetChild( oid, &coid); ODD(sts); sts = gdh_GetNextSibling(
coid, &coid)) {
sts = gdh_ObjidToName( coid, name, sizeof(name), cdh_mName_volumeStrict);
if ( EVEN(sts)) throw co_error(sts);
std::cout << "Child: " << name << '\n';
}
pwr_tStatus gdh_GetNextSibling(pwr_tObjid object, pwr_tObjid *nextSibling)
Get the object identity of the next sibling (i.e. the next object with the same parent).
Definition: rt_gdh.c:1465
pwr_tStatus gdh_GetChild(pwr_tObjid object, pwr_tObjid *firstChild)
Get the object identity of the first child of an object.
Definition: rt_gdh.c:1430
pwr_tStatus gdh_ObjidToName(pwr_tObjid oid, char *namebuf, pwr_tUInt32 size, pwr_tBitMask nametype)
Get the name of an object identified by its object identity.
Definition: rt_gdh.c:2371
#define EVEN(a)
Check if value is even.
Definition: pwr.h:623
int pwr_tStatus
Status type.
Definition: pwr.h:284
char pwr_tOName[199+1]
Full Object Name type.
Definition: pwr.h:396
#define ODD(a)
Check if value is odd.
Definition: pwr.h:618
Object identity type.
Definition: pwr.h:263
Returns
pwr_tStatus
Parameters
oidThe object identity.
new_oidRecevies the object identity of the first child.

Definition at line 1430 of file rt_gdh.c.

◆ gdh_GetClassInfo()

pwr_tStatus gdh_GetClassInfo ( pwr_tCid  cid,
gdh_sClassInfo info 
)

Get class info. Returns information from $ClassDef object.

Returns
pwr_tStatus

Definition at line 5631 of file rt_gdh.c.

◆ gdh_GetClassList()

pwr_tStatus gdh_GetClassList ( pwr_tClassId  cid,
pwr_tObjid oid 
)

Get the object identity of the first object in the list of objects of a specified class.

The call shows only private volumes (of class $RootVolume, $SubVolume, $DynamicVolume, $ClassVolume and $SystemVolume), and shared volumes.

Example

// Get all objects of class cid
for ( sts = gdh_GetClassList( cid); ODD(sts); sts = gdh_GetNextObject( oid,
&oid)) {
sts = gdh_ObjidToName( oid, name, sizeof(name), cdh_mName_volumeStrict);
if ( EVEN(sts)) throw co_error(sts);
std::cout << "Object: " << name << '\n';
}
pwr_tStatus gdh_GetClassList(pwr_tClassId classid, pwr_tObjid *object)
Get the object identity of the first object in the list of objects of a specified class.
Definition: rt_gdh.c:1627
pwr_tStatus gdh_GetNextObject(pwr_tObjid object, pwr_tObjid *nextObject)
Get the object identity of the next object in the list of objects of a certain class.
Definition: rt_gdh.c:1659
Returns
pwr_tStatus
Parameters
cidThe class identity.
oidReceives the object identity.

Definition at line 1627 of file rt_gdh.c.

◆ gdh_GetClassListAttrRef()

pwr_tStatus gdh_GetClassListAttrRef ( pwr_tClassId  cid,
pwr_sAttrRef arp 
)

Get the attribute reference of the first object in the list of objects of a specified class. The object can be a solitary object or an attribute object.

The call shows only private volumes (of class $RootVolume, $SubVolume, $DynamicVolume, $ClassVolume and $SystemVolume), and shared volumes.

Example

// Get all objects and attribute objects for class cid
for ( sts = gdh_GetClassListAttrRef( cid, &aref); ODD(sts); sts =
gdh_GetNextAttrRef( cid, &aref, &aref)) {
sts = gdh_AttrrefToName( &aref, name, sizeof(name),
cdh_mName_volumeStrict);
if ( EVEN(sts)) throw co_error(sts);
std::cout << "Object: " << name << '\n';
}
pwr_tStatus gdh_GetClassListAttrRef(pwr_tClassId cid, pwr_sAttrRef *arp)
Get the attribute reference of the first object in the list of objects of a specified class....
Definition: rt_gdh.c:1712
pwr_tStatus gdh_AttrrefToName(pwr_sAttrRef *attributeReference, char *nameBuffer, unsigned int sizeOfNameBuffer, pwr_tBitMask nameType)
Translate an attribute referece to a name.
Definition: rt_gdh.c:128
pwr_tStatus gdh_GetNextAttrRef(pwr_tClassId cid, pwr_sAttrRef *arp, pwr_sAttrRef *new_arp)
Get the attrref of the next object in the list of objects of a certain class. The object can be a sol...
Definition: rt_gdh.c:1742
char pwr_tAName[399+1]
Full Aref Name type.
Definition: pwr.h:397
Attribute reference.
Definition: pwr.h:557
See also
gdh_GetNextAttrRef
Returns
pwr_tStatus
Parameters
cidThe class identity.
arpReceives the attribute reference.

Definition at line 1712 of file rt_gdh.c.

◆ gdh_GetDeltaTimeDL()

void gdh_GetDeltaTimeDL ( pwr_tDeltaTime dtp,
pwr_tDeltaTime time 
)

Thread save function to fetch a direct linked delta time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).

Parameters
dtpDirect link to time attribute
timeReceives the requested time

Definition at line 5436 of file rt_gdh.c.

◆ gdh_GetDynamicAttrSize()

pwr_tStatus gdh_GetDynamicAttrSize ( pwr_tObjid  oid,
char *  name,
pwr_tUInt32 size 
)

Get the size of a dynamic attribute.

Returns
pwr_tStatus
Parameters
oidThe object identity.
nameAttribute name with leading point, eg ".Length".
sizeReceives the size in bytes of the object.

Definition at line 1055 of file rt_gdh.c.

◆ gdh_GetEnumValueDef()

pwr_tStatus gdh_GetEnumValueDef ( pwr_tTid  tid,
gdh_sValueDef **  vd,
int *  rows 
)

Get definition information for an enumeration type.

Returns a data stucture with the defined enumeration values and corresponding texts for an enumeration type. The datastructure is of type gdh_sValueDef, with an array of pointers to the values definition objects of the enumeration values.

The data structure should be freed with a free() call.

Parameters
tidEnumeration type id
vdRecieves a pointer to the data structure.
rowsNumber defined enum values

Definition at line 4117 of file rt_gdh.c.

◆ gdh_GetLocalParent()

pwr_tStatus gdh_GetLocalParent ( pwr_tObjid  oid,
pwr_tObjid new_oid 
)

Get the object identity of the local parent of an object.

If the parent is a MountObject, the objid for the MountObject will be returned, not the mounted object, as in gdh_GetParent:

See also
gdh_GetParent
Returns
pwr_tStatus
Parameters
oidThe identity of the object.
new_oidReceives the object identity of local parent.

Definition at line 1320 of file rt_gdh.c.

◆ gdh_GetMaskBitDef()

pwr_tStatus gdh_GetMaskBitDef ( pwr_tTid  tid,
gdh_sBitDef **  bd,
int *  rows 
)

Get definition information for a mask type.

Returns a data stucture with the defined bit values and corresponding texts for a mask type. The datastructure is of type gdh_sBitDef, which contains an array with ponters to the but definition objects for the bits.

The data structure should be freed with a free() call.

Parameters
tidType identity for mask.
bdReceives a pointer to the data structure.
rowsNumber of defined bit values.

Definition at line 4203 of file rt_gdh.c.

◆ gdh_GetNextAttrRef()

pwr_tStatus gdh_GetNextAttrRef ( pwr_tClassId  cid,
pwr_sAttrRef arp,
pwr_sAttrRef new_arp 
)

Get the attrref of the next object in the list of objects of a certain class. The object can be a solitary object or an attribute object.

The visibility of objects in the class list are restricted to objects in private volumes, (of class $RootVolume, $SubVolume, $DynamicVolume, $ClassVolume and $SystemVolume), and in shared volumes.

See also
Example in gdh_GetClassListAttrRef
Returns
pwr_tStatus
Parameters
cidThe class identity.
arpThe attribute reference.
new_arpReceives the attribute reference

Definition at line 1742 of file rt_gdh.c.

◆ gdh_GetNextObject()

pwr_tStatus gdh_GetNextObject ( pwr_tObjid  oid,
pwr_tObjid new_oid 
)

Get the object identity of the next object in the list of objects of a certain class.

The visibility of objects in the class list are restricted to objects in private volumes, (of class $RootVolume, $SubVolume, $DynamicVolume, $ClassVolume and $SystemVolume), and in shared volumes.

See also
Example in gdh_GetClassList
Returns
pwr_tStatus
Parameters
oidThe object identity.
new_oidReceives the object identity

Definition at line 1659 of file rt_gdh.c.

◆ gdh_GetNextObjectAttrRef()

pwr_tStatus gdh_GetNextObjectAttrRef ( pwr_tClassId  cid,
pwr_sAttrRef arp,
pwr_sAttrRef new_arp 
)

Get the attrref of the next attribute object of a specified class in a specified object.

Returns
pwr_tStatus
Parameters
cidThe class identity.
arpThe attribute reference.
new_arpReceives the attribute reference

Definition at line 1792 of file rt_gdh.c.

◆ gdh_GetNextSibling()

pwr_tStatus gdh_GetNextSibling ( pwr_tObjid  oid,
pwr_tObjid new_oid 
)

Get the object identity of the next sibling (i.e. the next object with the same parent).

See also
Example in gdh_GetChild
gdh_GetPreviousSibling
Returns
pwr_tStatus
Parameters
oidThe object identity.
new_oidReceives the object identity of the next sibling.

Definition at line 1465 of file rt_gdh.c.

◆ gdh_GetNextVolume()

pwr_tStatus gdh_GetNextVolume ( pwr_tVid  pvid,
pwr_tVid vid 
)

Get the next volume in the volume list.

The first volume can be fetched with gdh_GetVolumeList.

See also
Example in gdh_GetVolumeList
Returns
pwr_tStatus

Definition at line 3706 of file rt_gdh.c.

◆ gdh_GetNodeIndex()

pwr_tStatus gdh_GetNodeIndex ( pwr_tNodeId nid)

Get the node identity of the local node.

Returns
pwr_tStatus
Parameters
nidReceives node index of the local node

Definition at line 729 of file rt_gdh.c.

◆ gdh_GetNodeInfo()

pwr_tStatus gdh_GetNodeInfo ( pwr_tNodeId  nid,
gdh_sNodeInfo ip 
)

Return info for a node identified by a node identifier (of type pwr_tNodeId).

Returns
pwr_tStatus
Parameters
nidThe node index.
ipReceive the node info.

Definition at line 1854 of file rt_gdh.c.

◆ gdh_GetNodeObject()

pwr_tStatus gdh_GetNodeObject ( pwr_tNodeId  nid,
pwr_tObjid oid 
)

Return the objid of the node object for a node identified by a node identifier (of type pwr_tNodeId).

If the node identity is specified as zero, the node object for the local node is returned.

Returns
pwr_tStatus
Parameters
nidThe node index.
oidReceive the object identity.

Definition at line 1822 of file rt_gdh.c.

◆ gdh_GetObjectClass()

pwr_tStatus gdh_GetObjectClass ( pwr_tObjid  oid,
pwr_tClassId cid 
)

Get the class identifier of an object.

This information can be retrieved both for local and remote objects.

Returns
pwr_tStatus
Parameters
oidThe identity of the object.
cidReceives the object class identity.

Definition at line 1107 of file rt_gdh.c.

Referenced by gdh_GetAttrRefTid().

◆ gdh_GetObjectClassList()

pwr_tStatus gdh_GetObjectClassList ( pwr_tCid  cid,
pwr_tOid  oid,
pwr_sAttrRef arp 
)

Get the attribute reference of the first attribute object of a specified class in the specified object.

Returns
pwr_tStatus
Parameters
cidThe class identity.
oidHost object.
arpReceives the attribute reference.

Definition at line 1768 of file rt_gdh.c.

◆ gdh_GetObjectDLCount()

pwr_tStatus gdh_GetObjectDLCount ( pwr_tObjid  oid,
pwr_tUInt32 count 
)

Gets the direct link count of an object.

This information is can be fetched only for local objects.

Returns
pwr_tStatus
Parameters
oidThe object identity.
countReceives the value of the direct access counter of the object.

Definition at line 1251 of file rt_gdh.c.

◆ gdh_GetObjectInfo()

pwr_tStatus gdh_GetObjectInfo ( const char *  name,
pwr_tAddress  bufp,
pwr_tUInt32  bufsize 
)

Fetch data from an object or an attribute.

The caller gets blocked until the information is available. The caller is responsible for allocating a buffer where the information can be stored. If that buffer is to small, the information will be truncated.

Returns
pwr_tStatus
Todo:
Check if we can do it more efficient, eg. vol_ArefToAttribute
Parameters
nameName of object or object.parameter.
bufpPointer to a buffer of 'bufsize' bytes to be filled with requested information.
bufsizeSize of the 'bufp' buffer.

Definition at line 789 of file rt_gdh.c.

Referenced by gdh_GetObjectInfoDeltaTime(), gdh_GetObjectInfoStr(), and gdh_GetObjectInfoTime().

◆ gdh_GetObjectInfoAttrref()

pwr_tStatus gdh_GetObjectInfoAttrref ( pwr_sAttrRef arp,
void *  bufp,
unsigned int  bufsize 
)

Fetch the data of an attribute or a whole object body.

The function blocks until the information is available. The caller is responsible for allocating a buffer where the information can be stored. If that buffer is to small the information is truncated.

Returns
pwr_tStatus
Parameters
arpAttribute reference descriptor that defines an object or an object reference
bufpReceives the requested information
bufsizeThe size in bytes of the data buffer

Definition at line 916 of file rt_gdh.c.

Referenced by gdh_FWriteObject().

◆ gdh_GetObjectInfoDeltaTime()

pwr_tStatus gdh_GetObjectInfoDeltaTime ( const char *  name,
pwr_tDeltaTime time 
)

Fetch an delta time value from an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).

Returns
pwr_tStatus
Parameters
nameAttribute name
timeReceives the requested time

Definition at line 5548 of file rt_gdh.c.

References gdh_GetObjectInfo().

◆ gdh_GetObjectInfoStr()

pwr_tStatus gdh_GetObjectInfoStr ( const char *  name,
char *  str,
int  size 
)

Fetch a string value from an attribute. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str).

Returns
pwr_tStatus
Parameters
nameAttribute name
strReceives the requested string
sizeString size

Definition at line 5590 of file rt_gdh.c.

References gdh_GetObjectInfo().

◆ gdh_GetObjectInfoTime()

pwr_tStatus gdh_GetObjectInfoTime ( const char *  name,
pwr_tTime *  time 
)

Fetch an absolute time value from an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).

Returns
pwr_tStatus
Parameters
nameAttribute name
timeReceives the requested time

Definition at line 5506 of file rt_gdh.c.

References gdh_GetObjectInfo().

◆ gdh_GetObjectLocation()

pwr_tStatus gdh_GetObjectLocation ( pwr_tObjid  oid,
pwr_tBoolean location 
)

Return the location of an object.

The argument 'location' will get the value TRUE if the object is local, i.e. the object is in a volume owned by the local node, else the value FALSE.

Returns
pwr_tStatus
Parameters
oidThe identity of the object.
locationReceives the location. TRUE means local and FALSE remote.

Definition at line 1219 of file rt_gdh.c.

◆ gdh_GetObjectNodeIndex()

pwr_tStatus gdh_GetObjectNodeIndex ( pwr_tObjid  oid,
pwr_tNodeId nid 
)

Get the node identity of the owner node of an object.

Returns
pwr_tStatus
Parameters
oidObject identity.
nidReceives the node index.

Definition at line 750 of file rt_gdh.c.

◆ gdh_GetObjectSize()

pwr_tStatus gdh_GetObjectSize ( pwr_tObjid  oid,
pwr_tUInt32 size 
)

Get the size of the body of an object.

This information can be retrieved both for local and remote objects.

Returns
pwr_tStatus
Parameters
oidThe object identity.
sizeReceives the size in bytes of the object.

Definition at line 1025 of file rt_gdh.c.

Referenced by gdh_FWriteObject().

◆ gdh_GetParent()

pwr_tStatus gdh_GetParent ( pwr_tObjid  oid,
pwr_tObjid new_oid 
)

Get the object identity of the parent of an object.

See also
gdh_GetLocalParent
Returns
pwr_tStatus
Parameters
oidThe identity of the object.
new_oidReceives the object identity of the parent.

Definition at line 1281 of file rt_gdh.c.

◆ gdh_GetPreviousObject()

pwr_tStatus gdh_GetPreviousObject ( pwr_tObjid  oid,
pwr_tObjid new_oid 
)

Get the object identity of the previous object in the list of objects of a certain class.

The visibility of objects in the class list are restricted to objects in private volumes, (of class $RootVolume, $SubVolume, $DynamicVolume, $ClassVolume and $SystemVolume), and in shared volumes.

Returns
pwr_tStatus
Parameters
oidThe object identity.
new_oidReceives the identity of the previos object.

Definition at line 2031 of file rt_gdh.c.

◆ gdh_GetPreviousSibling()

pwr_tStatus gdh_GetPreviousSibling ( pwr_tObjid  oid,
pwr_tObjid new_oid 
)

Get the object identity of the previous sibling (i.e. the previous object with the same parent).

See also
gdh_GetNextSibling
Returns
pwr_tStatus
Parameters
oidThe object identity.
new_oidReceievs the object identity for the previous sibling.

Definition at line 1509 of file rt_gdh.c.

◆ gdh_GetRootList()

pwr_tStatus gdh_GetRootList ( pwr_tObjid oid)

Get the first root object in the object tree.

Returns the object identity for the first root object.
Other root objects are fetched with gdh_GetNextSibling.

Example

// Get all top objects on this node
for ( sts = gdh_GetRootList( &oid); ODD(sts); sts = gdh_GetNextSibling( oid,
&oid)) {
sts = gdh_ObjidToName( oid, name, sizeof(name), cdh_mName_volumeStrict);
if ( EVEN(sts)) throw co_error(sts);
std::cout << "Top object: " << name << '\n';
}
pwr_tStatus gdh_GetRootList(pwr_tObjid *object)
Get the first root object in the object tree.
Definition: rt_gdh.c:1571
See also
gdh_GetNextSibling
Returns
pwr_tStatus
Parameters
oidReceives the object identity of the first root object.

Definition at line 1571 of file rt_gdh.c.

◆ gdh_GetRootVolume()

pwr_tStatus gdh_GetRootVolume ( pwr_tVid vid)

Get info for a volume.

Parameters
vidVolume identity

Definition at line 3801 of file rt_gdh.c.

◆ gdh_GetSecurityInfo()

pwr_tStatus gdh_GetSecurityInfo ( pwr_sSecurity *  security)

Get security information.

Returns the content of the $Securiy object of the current node.

Returns
pwr_tStatus
Parameters
securityPointer to buffer supplied by the user

Definition at line 5165 of file rt_gdh.c.

References gdh_ObjidToName().

◆ gdh_GetStrDL()

void gdh_GetStrDL ( char *  sp,
char *  str,
int  size 
)

Thread save function to fetch a direct linked string value. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str).

Parameters
spDirect link to string attribute
strReceives the requested string
sizeSize of string

Definition at line 5470 of file rt_gdh.c.

◆ gdh_GetSubscriptionOldness()

pwr_tStatus gdh_GetSubscriptionOldness ( pwr_tSubid  sid,
pwr_tBoolean old,
pwr_tTime *  lastupdate,
pwr_tStatus status 
)

Checks the oldness of a certain subscription.

Data gets ‘old’ after a certain timeout-time, when no updates are refreshing the data.

Returns
pwr_tStatus
Parameters
sidSubscription to examine.
oldPointer to where the oldness flag is stored or NULL.
lastupdatePointer to where the 64-bit time value of last update is stored or NULL.
statusStatus of last data transfer.

Definition at line 1358 of file rt_gdh.c.

References cdh_uRid::pwr.

◆ gdh_GetSuperClass()

pwr_tStatus gdh_GetSuperClass ( pwr_tCid  cid,
pwr_tCid supercid,
pwr_tObjid  oid 
)

Get the superclass for a class.

If the class for a remote object is examined, the class might not be loded on the local, and in this case the object itself has to supplied in the oid argument. For local classes, this argument can be set to pwr_cNOid.

Example

pwr_tCid supercid;
sts = gdh_GetSuperClass( cid, &supercid, pwr_cNOid);
pwr_tStatus gdh_GetSuperClass(pwr_tCid cid, pwr_tCid *supercid, pwr_tObjid oid)
Get the superclass for a class.
Definition: rt_gdh.c:4054
unsigned int pwr_tCid
Class identity type.
Definition: pwr.h:273
Returns
pwr_tStatus
Parameters
cidClass identity.
supercidReceived class identity for the super class.
oidObject id for remote object, normally pwr_cNOid

Definition at line 4054 of file rt_gdh.c.

◆ gdh_GetTimeDL()

void gdh_GetTimeDL ( pwr_tTime *  atp,
pwr_tTime *  time 
)

Thread save function to fetch a direct linked absolute time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).

Parameters
atpDirect link to time attribute
timeReceives the requested time

Definition at line 5397 of file rt_gdh.c.

◆ gdh_GetVolumeInfo()

pwr_tStatus gdh_GetVolumeInfo ( pwr_tVid  vid,
gdh_sVolumeInfo info 
)

Get info for a volume.

Parameters
vidVolume identity
infoPointer to info area, supplied by the user

Definition at line 3771 of file rt_gdh.c.

◆ gdh_GetVolumeList()

pwr_tStatus gdh_GetVolumeList ( pwr_tVid vid)

Get the first volume.

Other volumes can be fetched with gdh_GetNextVolume.

Example

// Get all volumes
for ( sts = gdh_GetVolumeList( &vid); ODD(sts); sts = gdh_GetNextVolume( vid,
&vid)) {
sts = gdh_VolumeIdToName( vid, vname, sizeof(vname));
if (EVEN(sts)) throw co_error(sts);
std::cout << "Volume: " << vname << '\n';
}
pwr_tStatus gdh_GetVolumeList(pwr_tVid *vid)
Get the first volume.
Definition: rt_gdh.c:3678
pwr_tStatus gdh_VolumeIdToName(pwr_tVid vid, char *name, int size)
Get the name for a volume denoted by volume identity.
Definition: rt_gdh.c:3744
pwr_tStatus gdh_GetNextVolume(pwr_tVid pvid, pwr_tVid *vid)
Get the next volume in the volume list.
Definition: rt_gdh.c:3706
unsigned int pwr_tVid
Volume identity type.
Definition: pwr.h:237
char pwr_tObjName[31+1]
Object name type.
Definition: pwr.h:377
See also
gdh_GetNextVolume
Returns
pwr_tStatus
Parameters
vidRecieves the volume identity for the first volume.

Definition at line 3678 of file rt_gdh.c.

◆ gdh_Init()

pwr_tStatus gdh_Init ( const char *  name)

Initialize the process to the Proview runtime environment.

Example

sts = gdh_Init( "my_appl");
if ( EVEN(sts)) throw co_error(sts);
pwr_tStatus gdh_Init(const char *name)
Initialize the process to the Proview runtime environment.
Definition: rt_gdh.c:2065
Parameters
nameProcess name

Definition at line 2065 of file rt_gdh.c.

◆ gdh_IsInitialized()

pwr_tBoolean gdh_IsInitialized ( )

Check if gdh is initialized. Returns TRUE if gdh is initialized, else FALSE.

Returns
pwr_tBoolean

Definition at line 5661 of file rt_gdh.c.

◆ gdh_MountObjidToPointer()

pwr_tStatus gdh_MountObjidToPointer ( pwr_tObjid  oid,
void **  p 
)

Get a pointer to a mount object.

Returns
pwr_tStatus
Parameters
oidThe object identity.
pReveives a pointer to the object.

Definition at line 2464 of file rt_gdh.c.

◆ gdh_MoveObject()

pwr_tStatus gdh_MoveObject ( pwr_tObjid  oid,
pwr_tObjid  poid 
)

Move a local object.

This call is possible only if the object is in a local volume, i.e a volume owned by the local node. The volume must be of class $DynamicVolume or $SystemVolume. All reachable nodes, who have mounted the volume in question, are notified about the move of this object.

Returns
pwr_tStatus
Parameters
oidThe object that should be moved.
poidThe object that should become the new parent.

Definition at line 2162 of file rt_gdh.c.

References cdh_ObjidIsNull().

◆ gdh_NameToAttrref()

pwr_tStatus gdh_NameToAttrref ( pwr_tObjid  poid,
const char *  name,
pwr_sAttrRef arp 
)

Converts from name string to attribute reference.

Example

pwr_tAName name = "H1-H2-Temperature.ActualValue";
sts = gdh_NameToAttrref( pwr_cNOid, name, &aref);
if ( EVEN(sts)) throw co_error(sts);
pwr_tStatus gdh_NameToAttrref(pwr_tObjid parent, const char *attributeName, pwr_sAttrRef *attributeReference)
Converts from name string to attribute reference.
Definition: rt_gdh.c:2314
Returns
pwr_tStatus
Parameters
poidThis object is added to the Name argument to form the complete name of the object/attribute. It should be specified as pwr_cNobjid if it is not used.
nameThe argument is added to the parent to form the complete item name. If the parent argument is supplied as pwr_cNobjid, this argument is considered to describe the full name.
arpThe resulting attribute reference descriptor.

Definition at line 2314 of file rt_gdh.c.

Referenced by gdh_RefObjectInfoList().

◆ gdh_NameToObjid()

pwr_tStatus gdh_NameToObjid ( const char *  name,
pwr_tObjid oid 
)

Get the object identity of an object with name 'name'.

Example

pwr_tOName name = "H1-H2-Valve";
sts = gdh_NameToObjid( name, &oid);
if ( EVEN(sts)) throw co_error(sts);
pwr_tStatus gdh_NameToObjid(const char *objectName, pwr_tObjid *objid)
Get the object identity of an object with name 'name'.
Definition: rt_gdh.c:2202
Returns
pwr_tStatus
Parameters
nameThe object name.
oidreceives the identity of the object.

Definition at line 2202 of file rt_gdh.c.

◆ gdh_NameToPointer()

pwr_tStatus gdh_NameToPointer ( const char *  name,
void **  p 
)

Get the address of the data of an object, given its name.

Only local objects are handled.

Returns
pwr_tStatus
Parameters
nameThe name of the object.
pReceives a pointer to the object.

Definition at line 2240 of file rt_gdh.c.

◆ gdh_NethandlerRunning()

pwr_tStatus gdh_NethandlerRunning ( void  )

Check if the Nethandler has started.

Returns GDH__SUCCESS if the nethandler is running, else GDH__NONETHANDLER.

Example

// Wait for nethandler to start
sleep(5);
pwr_tStatus gdh_NethandlerRunning(void)
Check if the Nethandler has started.
Definition: rt_gdh.c:2284
Returns
pwr_tStatus

Definition at line 2284 of file rt_gdh.c.

◆ gdh_ObjidToName()

pwr_tStatus gdh_ObjidToName ( pwr_tObjid  oid,
char *  namebuf,
pwr_tUInt32  size,
pwr_tBitMask  nametype 
)

Get the name of an object identified by its object identity.

Example

sts = gdh_ObjidToName( oid, name, sizeof(name), cdh_mName_volumeStrict);
if ( EVEN(sts)) throw co_error(sts);

The caller is responsible for supplying a sufficient buffer.

Returns
pwr_tStatus
Parameters
oidObject id of an object.
namebufA buffer where the name can be put.
sizeSize of namebuf.
nametypeMask of type cdh_mName.

Definition at line 2371 of file rt_gdh.c.

Referenced by gdh_AttrrefToName(), and gdh_GetSecurityInfo().

◆ gdh_ObjidToPointer()

pwr_tStatus gdh_ObjidToPointer ( pwr_tObjid  oid,
void **  p 
)

Gets the address of the data of an object, given its object identity.

Nota bene ! Only local objects can be referenced.

Returns
pwr_tStatus
Parameters
oidThe object identity.
pReveives a pointer to the object.

Definition at line 2431 of file rt_gdh.c.

◆ gdh_RefObjectInfo()

pwr_tStatus gdh_RefObjectInfo ( char *  name,
void **  infop,
pwr_tSubid sid,
unsigned int  size 
)

The routine returns an address to the data that is denoted by Name. The name can be either an object or an object attribute.

If the object is known and is local, this call will result in a gdh_DLRefObjectInfo, otherwise it will result in a gdh_SubRefObjectInfo.

Some important considerations:
This call is preferable to gdh_NameToPointer or gdh_ObjidToPointer since it prevents the data from being removed until you dereference it. If you need data repeatedly use the gdh_RefObject routines, for a single request use gdh_GetObjectInfo. You may read and write data on the local node. But if the data exists on another node writing will have no effect, since the data will be overwritten by the next subscription update. If you need to write data on another node use gdh_SetObjectInfo. If you want to issue several requests at the same time use gdh_RefObjectInfoList, this is much more efficient than repeated calls to gdh_RefObjectInfo.

See also
gdh_UnrefObjectinfo

Example

pwr_tOName name = "H1-H2-Temperature.ActualValue";
pwr_tSubid subid;
pwr_tFloat32 *valuep;
sts = gdh_RefObjectInfo( name, &valuep, &subid, sizeof(*valuep));
if ( EVEN(sts)) throw co_error(sts);
...
sts = gdh_UnrefObjectInfo( subid);
pwr_tStatus gdh_UnrefObjectInfo(pwr_tSubid subid)
Terminates the subscription defined by the subscription identity.
Definition: rt_gdh.c:3470
pwr_tStatus gdh_RefObjectInfo(char *attributeName, void **objectData, pwr_tSubid *subid, unsigned int sizeOfObjectData)
The routine returns an address to the data that is denoted by Name. The name can be either an object ...
Definition: rt_gdh.c:3426
pwr_tRid pwr_tSubid
Subscription identity type.
Definition: pwr.h:312
float pwr_tFloat32
32-bit float.
Definition: pwr.h:131
See also
gdh_UnrefObjectInfo();
Returns
pwr_tStatus
Parameters
nameSupplies the name of an object or object and attribute.
infopReceives a pointer to the requested information.
sidReceives the subscription identity.
sizeSize of the subscribed data.

Definition at line 3426 of file rt_gdh.c.

References gdh_sObjRef::adrs, gdh_sObjRef::bufsize, gdh_sObjRef::fullname, gdh_RefObjectInfoList(), and ODD.

Referenced by ra_appl::open().

◆ gdh_RefObjectInfoList()

pwr_tStatus gdh_RefObjectInfoList ( unsigned int  n,
gdh_sObjRef objref,
pwr_tSubid sid 
)

This routine returns addresses to the information that is denoted by "objref[].fullname".

The name can be either an object or an object parameter. Optionally, the subid array can be supplied. If there is such an argument, it is assumed to have n elements. This can be used to retrieve further info about a particular subscription. If a NULL address is received in an objref[].adrs, that particular subscription never was requested due to some error.

This routine remains only because of compatibility with applications that uses the GDH V1 interface. The logic is emulated using the new, GDH V2 interface. The only internal knowledge is about Subids, if the high byte is 0 then it is a Dlid, otherwise a Subid!

Parameters
n# of entries in objref and subid.
objrefInput: Name list: objects or object.attributes Output: Address list.
sidSubids corresponding to objrefs. If supplied as NULL, it is ignored.

Definition at line 3265 of file rt_gdh.c.

References gdh_NameToAttrref().

Referenced by gdh_RefObjectInfo().

◆ gdh_RenameObject()

pwr_tStatus gdh_RenameObject ( pwr_tObjid  oid,
char *  name 
)

Rename a local object.

This call is possible only if the object is in a local volume, i.e a volume owned by the local node. The volume must be of class $DynamicVolume or $SystemVolume. All reachable nodes, who have mounted the volume in question, are notified about the renaming of this object.

Returns
pwr_tStatus
Parameters
oidThe object identity that should be renamed.
nameThe new name.

Definition at line 2534 of file rt_gdh.c.

◆ gdh_SetAlarmBlockLevel()

pwr_tStatus gdh_SetAlarmBlockLevel ( pwr_tObjid  oid,
pwr_tUInt32  blocklevel 
)

Sets the alarm block level for a certain object.

The block level is propagated upwards to its parents as long as the new alarm level is higher than the old.

Returns
pwr_tStatus
Parameters
oidObject identity for the object
blocklevelNew block level

Definition at line 3545 of file rt_gdh.c.

◆ gdh_SetAlarmLevel()

pwr_tStatus gdh_SetAlarmLevel ( pwr_tObjid  oid,
pwr_tUInt32  alarmlevel 
)

This routine sets the alarm level for a certain object.

The alarm level is propagated upwards to its parents as long as the new alarm level is higher than the old.

Returns
pwr_tStatus
Parameters
oidObject identity for the object
alarmlevelNew alarm level

Definition at line 3514 of file rt_gdh.c.

◆ gdh_SetDeltaTimeDL()

void gdh_SetDeltaTimeDL ( pwr_tDeltaTime dtp,
pwr_tDeltaTime time 
)

Thread save function to store a direct linked delta time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).

Parameters
dtpDirect link to time attribute
timeTime value to set

Definition at line 5453 of file rt_gdh.c.

◆ gdh_SetObjectInfo()

pwr_tStatus gdh_SetObjectInfo ( const char *  name,
void *  bufp,
unsigned int  bufsize 
)

Change the value of an attribute or the whole body of an object.

The routine stalls until the operation is performed. The caller is responsible for the information in the buffer. If the buffer is shorter then what is required, then a partial update takes place.

Example

pwr_tOName name = "H1-H2-Temperature.ActualValue";
pwr_tFloat32 value = 1.23;
sts = gdh_SetObjectInfo( name, &value, sizeof(value));
if ( EVEN(sts)) throw co_error(sts);
pwr_tStatus gdh_SetObjectInfo(const char *attributeName, void *buffer, unsigned int sizeOfBuffer)
Change the value of an attribute or the whole body of an object.
Definition: rt_gdh.c:2579
Returns
pwr_tStatus
Todo:
Check if we can do it more efficient, eg. vol_ArefToAttribute
Parameters
nameThe name of the object or object attribute.
bufpPointer to the data.
bufsizeThe size in bytes of the data buffer.

Definition at line 2579 of file rt_gdh.c.

Referenced by gdh_SetObjectInfoDeltaTime(), gdh_SetObjectInfoStr(), and gdh_SetObjectInfoTime().

◆ gdh_SetObjectInfoAttrref()

pwr_tStatus gdh_SetObjectInfoAttrref ( pwr_sAttrRef arp,
void *  bufp,
unsigned int  bufsize 
)

Change the data of an object or an attribute.

The routine stalls until the operation is performed. The caller is responsible for the information in the buffer. If the buffer is shorter then what is required, then a partial update takes place.

Example

pwr_tFloat32 value = 1.23;
sts = gdh_SetObjectInfoAttrref( &aref, &value, sizeof(value));
if ( EVEN(sts)) throw co_error(sts);
pwr_tStatus gdh_SetObjectInfoAttrref(pwr_sAttrRef *attributeReference, void *buffer, unsigned int sizeOfBuffer)
Change the data of an object or an attribute.
Definition: rt_gdh.c:2722
Returns
pwr_tStatus
Parameters
arpSupplies the attribute reference decriptor that defines an object or an object and attribute.
bufpPointer to the data.
bufsizeThe size in bytes of the data buffer.

Definition at line 2722 of file rt_gdh.c.

Referenced by gdh_FReadObject().

◆ gdh_SetObjectInfoDeltaTime()

pwr_tStatus gdh_SetObjectInfoDeltaTime ( const char *  name,
pwr_tDeltaTime time 
)

Store a delta time value in an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).

Returns
pwr_tStatus
Parameters
nameAttribute name
timeTime to set

Definition at line 5569 of file rt_gdh.c.

References gdh_SetObjectInfo().

◆ gdh_SetObjectInfoStr()

pwr_tStatus gdh_SetObjectInfoStr ( const char *  name,
const char *  str,
int  size 
)

Store a string value in an attribute. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str).

Returns
pwr_tStatus
Parameters
nameAttribute name
strString to set
sizeString size

Definition at line 5612 of file rt_gdh.c.

References gdh_SetObjectInfo().

◆ gdh_SetObjectInfoTime()

pwr_tStatus gdh_SetObjectInfoTime ( const char *  name,
pwr_tTime *  time 
)

Store an absolute time value in an attribute. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).

Returns
pwr_tStatus
Parameters
nameAttribute name
timeTime to set

Definition at line 5527 of file rt_gdh.c.

References gdh_SetObjectInfo().

◆ gdh_SetStrDL()

void gdh_SetStrDL ( char *  sp,
const char *  str,
int  size 
)

Thread save function to store a direct linked string value. Sets the string lock to ensure that the string is not modified during the operation. The application first has to attach the string lock with a call to lck_Create(&sts, lck_eLock_Str).

Parameters
spDirect link to string attribute
strString value to set
sizeSize of string

Definition at line 5487 of file rt_gdh.c.

◆ gdh_SetSubscriptionDefaults()

pwr_tStatus gdh_SetSubscriptionDefaults ( pwr_tInt32  dt,
pwr_tInt32  tmo 
)

Sets default subscription timers for future subscription requests.

Supply negative values for no change. A value of zero resets the default values.

Parameters
dtDefault update time for subscription requests to come, in ms.
tmoDefault timeout (i.e. time until data gets flagged as old), in ms.

Definition at line 3234 of file rt_gdh.c.

◆ gdh_SetTimeDL()

void gdh_SetTimeDL ( pwr_tTime *  atp,
pwr_tTime *  time 
)

Thread save function to store a direct linked absolute time value. Sets the time lock to ensure that the time is not modified during the operation. The application first has to attach the time lock with a call to lck_Create(&sts, lck_eLock_Time).

Parameters
atpDirect link to time attribute
timeTime value to set

Definition at line 5413 of file rt_gdh.c.

References time_GetTime().

◆ gdh_SubAssociateBuffer()

pwr_tStatus gdh_SubAssociateBuffer ( pwr_tSubid  sid,
void **  buffer,
unsigned int  buffersize 
)

Associate a buffer with the subscription.

If a buffer already is associated, that buffer will be returned, if compatible in size. Otherwise an error will be returned.

Returns
pwr_tStatus

todo !!! Try to understand this code!, LW? I think it shall be usersize instead of userdata, ML. Please verify.

Parameters
sidSubscription referenced.
bufferAddress of buffer that gets allocated for the caller.
buffersizeRequested size in bytes of user buffer.

Definition at line 3186 of file rt_gdh.c.

◆ gdh_SubData()

pwr_tStatus gdh_SubData ( pwr_tSubid  subid,
void *  buffer,
unsigned int  sizeOfBuffer 
)

Fetch the data associated with a subscription.

Parameters
subidSubscription to fetch data from.
bufferUser supplied buffer where data is put.
sizeOfBufferSize in bytes of user buffer.

Definition at line 3064 of file rt_gdh.c.

◆ gdh_SubRefObjectInfoAttrref()

pwr_tStatus gdh_SubRefObjectInfoAttrref ( pwr_sAttrRef aref,
pwr_tSubid sid 
)

This routine returns a subid to the information that is denoted by 'aref'. The name can be either an object or an object attribute.

Since this routine operates on a single data item, it is pretty slow. For faster setup of many subscriptions in one call, use gdh_SubRefObjectInfoList.

Returns
pwr_tStatus
Parameters
arefReference to an object.attribute.
sidReturned handle.

Definition at line 2917 of file rt_gdh.c.

◆ gdh_SubRefObjectInfoList()

pwr_tStatus gdh_SubRefObjectInfoList ( unsigned int  nentries,
void *  object[],
pwr_tBoolean  is_aref[],
pwr_tSubid  subid[] 
)

Sets up a list of subscriptions to an object/attribute.

Much more efficient way to establish a number of subscriptions than calling gdh_SubRefObjectInfoAttrref or gdh_SubRefObjectInfoName

Returns
pwr_tStatus
Parameters
nentriesNumber of entries in the object[], attrref[] and subid[] arrays.
objectThe address of an array with either the address of a name string or the address of an pwr_sAttrRef identifying the objects or parameters to establish subscriptions for.
is_arefTrue if the corresponding object[] entry is an attrref. Otherwise it is regarded as a name string.
subidReturned handles with index matching the object argument. The array must be declared by the caller.

Definition at line 2844 of file rt_gdh.c.

◆ gdh_SubRefObjectInfoName()

pwr_tStatus gdh_SubRefObjectInfoName ( char *  name,
pwr_tSubid sid 
)

Get the address of the data that is denoted by 'name'.

The name can be either a whole object or an object attribute.

Since this routine operates on a single data item, it is pretty slow. For faster setup of many subscriptions in one call, use gdh_SubRefObjectInfoList.

Parameters
nameName of an object or object.attribute.
sidReturned handle.

Definition at line 2944 of file rt_gdh.c.

◆ gdh_SubSize()

pwr_tStatus gdh_SubSize ( pwr_tSubid  subid,
unsigned int *  size 
)

Fetch the data size associated with a subscription.

Parameters
subidSubscription referenced.
sizeSubscription size in bytes.

Definition at line 3150 of file rt_gdh.c.

◆ gdh_SubUnrefObjectInfo()

pwr_tStatus gdh_SubUnrefObjectInfo ( pwr_tSubid  sid)

Terminates subscription of an object or an attribute.

Returns
pwr_tStatus

< ERROR

Parameters
sidSubscription to terminate.

Definition at line 3033 of file rt_gdh.c.

References gdh_SubUnrefObjectInfoList().

◆ gdh_SubUnrefObjectInfoList()

pwr_tStatus gdh_SubUnrefObjectInfoList ( unsigned int  nentries,
pwr_tSubid sid 
)

Terminates a list of subscriptions.

All invalid pwr_tSubids remain in the list. The valid pwr_tSubids are zeroed out!

Returns
pwr_tStatus

< INFORMATION

Parameters
nentries# of pwr_tSubids in the array.
sidArray of subscriptions to terminate.

Definition at line 2970 of file rt_gdh.c.

Referenced by gdh_SubUnrefObjectInfo().

◆ gdh_TranslateRtdbPointer()

void* gdh_TranslateRtdbPointer ( unsigned long  r)

Convert rtdb relative pointer to absolute pointer.

Returns
pwr_tStatus

Definition at line 3593 of file rt_gdh.c.

◆ gdh_UnrefObjectInfo()

pwr_tStatus gdh_UnrefObjectInfo ( pwr_tSubid  sid)

Terminates the subscription defined by the subscription identity.

The pointer returned by for example gdh_RefObjectInfo is invalid after this call.

N.B.! The user is responsible for removing all subscriptions before terminating a process, the system will not do it for you. This call will result in either a gdh_DLUnrefObjectInfo or a gdh_SubUnrefObjectInfo.

See also
gdh_RefObjectInfo, gdh_DLUnrefObjectInfo, gdh_SubUnrefObjectInfo
Returns
pwr_tStatus
Parameters
sidThe subscription to terminate.

Definition at line 3470 of file rt_gdh.c.

References cdh_uRid::pwr, and cdh_uRid::r.

Referenced by ra_appl::close().

◆ gdh_UnrefObjectInfoAll()

pwr_tStatus gdh_UnrefObjectInfoAll ( void  )

Terminates all subscriptions set up by this process.

This call will result in either a gdh_DLUnrefObjectInfoAll or a gdh_SubUnrefObjectInfoAll.

See also
gdh_DLUnrefObjectInfoAll, gdhSubUnrefObjectInfoAll
Returns
pwr_tStatus

Definition at line 3498 of file rt_gdh.c.

References gdh_DLUnrefObjectInfoAll(), and gdh_SubUnrefObjectInfoAll().

◆ gdh_VolumeIdToName()

pwr_tStatus gdh_VolumeIdToName ( pwr_tVid  vid,
char *  name,
int  size 
)

Get the name for a volume denoted by volume identity.

See also
Example in gdh_GetVolumeList
Returns
pwr_tStatus
Parameters
vidVolume identity
nameName buffer, allocated by the user
sizeSize of name buffer

Definition at line 3744 of file rt_gdh.c.