MAK Legion 1.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Typedefs | Functions
c_database.h File Reference

Go to the source code of this file.

Typedefs

typedef void(* C_BeginFrameCallback )(void *usr, double simTime)
 
typedef void(* C_EndFrameCallback )(void *usr)
 

Functions

LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_createSimulationDatabase (const ConfigHandle config, DatabaseHandle *dbHandle)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_destroySimulationDatabase (DatabaseHandle db)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_viewManager (DatabaseHandle db, ViewManagerHandle *viewManagerHandle)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_eventManager (DatabaseHandle db, EventManagerHandle *eventManagerHandle)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_controlManager (DatabaseHandle db, ControlManagerHandle *controlManagerHandle)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_reserve (DatabaseHandle db, AttributeSetId setType, UInt32 count)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_capacity (DatabaseHandle db, AttributeSetId setType, UInt32 *count)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_beginFrame (DatabaseHandle db, double simTime)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_endFrame (DatabaseHandle db)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_inFrame (DatabaseHandle db, LEG_Bool *inFrame)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_simTime (DatabaseHandle db, double *simTime)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_currentFrame (DatabaseHandle db, UInt64 *frameCount)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_clientId (DatabaseHandle db, ClientId *clientId)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_setClientId (DatabaseHandle db, ClientId clientId)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_addBeginFrameCallback (DatabaseHandle db, C_BeginFrameCallback func, void *usr)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_addEndFrameCallback (DatabaseHandle db, C_EndFrameCallback func, void *usr)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_removeBeginFrameCallback (DatabaseHandle db, C_BeginFrameCallback func, void *usr)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_removeEndFrameCallback (DatabaseHandle db, C_EndFrameCallback func, void *usr)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_registerAttributeSet (DatabaseHandle db, const LEG_AttributeSetDescriptor *setDesc, AttributeSetId *setId)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_findAttributeSetId (DatabaseHandle db, const char *setName, AttributeSetId *setId)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_registerAttribute (DatabaseHandle db, AttributeSetId setId, const LEG_AttributeDescriptor *descriptor, AttributeIndex *index)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_findAttributeIndexByName (DatabaseHandle db, AttributeSetId setId, const char *attributeName, AttributeIndex *index)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_findAttributeIndexById (DatabaseHandle db, AttributeSetId setId, UInt32 attrId, AttributeIndex *index)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_createInstance (DatabaseHandle db, AttributeSetId setId, InstanceHandle *handle)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_destroyInstance (InstanceHandle inst)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_setTypeForInstance (InstanceHandle inst, UInt32 *setType)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_getGlobalId (InstanceHandle inst, GlobalId *gidPtr)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_getClientId (InstanceHandle inst, ClientId *clientIdPtr)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_isValid (InstanceHandle inst, LEG_Bool *isValid)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_getInstanceId (DatabaseHandle db, GlobalId globalId, InstanceHandle *handlePtr)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_getDatabaseHandleForInstance (InstanceHandle inst, DatabaseHandle *dbHandle)
 

Typedef Documentation

typedef void(* C_BeginFrameCallback)(void *usr, double simTime)

Begin frame callback function

typedef void(* C_EndFrameCallback)(void *usr)

End frame callback function

Function Documentation

LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_addBeginFrameCallback ( DatabaseHandle  db,
C_BeginFrameCallback  func,
void *  usr 
)

Add and register a callback function to get invoked by database at DB begin frame

Parameters
[in]dbThe database handle
[in]funcA callback function to be registered
[in]usrUser data passed to the callback function
See Also
C_BeginFrameCallback
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_addEndFrameCallback ( DatabaseHandle  db,
C_EndFrameCallback  func,
void *  usr 
)

Add and register a callback function to get invoked by database at DB end frame

Parameters
[in]dbThe database handle
[in]funcA callback function to be registered
[in]usrUser data passed to the callback function
See Also
C_EndFrameCallback
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_beginFrame ( DatabaseHandle  db,
double  simTime 
)

Legion database begin frame call, tells the simulation database the simulation time and begins bookkeeping work

Parameters
[in]dbThe database handle
[in]simTimeThe simulation time
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_capacity ( DatabaseHandle  db,
AttributeSetId  setType,
UInt32 count 
)

Reserve database for attribute set

Parameters
[in]dbThe database handle
[in]setTypeAn unique identifier of attributeSet
[out]countReturn the capacity reserved for this type of attributeSet
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_clientId ( DatabaseHandle  db,
ClientId clientId 
)

Get client id

Parameters
[in]dbThe database handle
[out]clientIdReturn client identifier
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_controlManager ( DatabaseHandle  db,
ControlManagerHandle controlManagerHandle 
)

Get control manager

Parameters
[in]dbThe database handle
[out]controlManagerHandleReturn control manager handle
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_createInstance ( DatabaseHandle  db,
AttributeSetId  setId,
InstanceHandle handle 
)

Create an instance of attributeSet

Parameters
[in]dbThe database handle
[in]setIdThe attributeSet identifier
[out]handleOutput the instance handle of newly created attributeSet instance
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure

Referenced by Legion::SimulationDatabase::createInstance(), and Legion::createInstance().

LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_createSimulationDatabase ( const ConfigHandle  config,
DatabaseHandle dbHandle 
)

Create simulation database

Parameters
[in]configThe configuration handle
[out]typeReturn the database handle created
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_currentFrame ( DatabaseHandle  db,
UInt64 frameCount 
)

Get the current frame number

Parameters
[in]dbThe database handle
[out]frameCountReturn the current frame number
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_destroyInstance ( InstanceHandle  inst)

Delete an instance of attributeSet

Parameters
[in]instThe instance handle of attributeSet to delete
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_destroySimulationDatabase ( DatabaseHandle  db)

Delete simulation database

Parameters
[in]dbThe database handle
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_endFrame ( DatabaseHandle  db)

Legion database end frame call, finishes bookkeeping work

Parameters
[in]dbThe database handle
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_eventManager ( DatabaseHandle  db,
EventManagerHandle eventManagerHandle 
)

Get event manager

Parameters
[in]dbThe database handle
[out]eventManagerHandleReturn event manager handle
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_findAttributeIndexById ( DatabaseHandle  db,
AttributeSetId  setId,
UInt32  attrId,
AttributeIndex index 
)

Get database attribute table index using the attributeSet id and attribute id

Parameters
[in]dbThe database handle
[in]setIdThe attributeSet identifier
[in]attributeIdThe attribute identifier
[out]indexOutput the attribute's table index of this attributeSet
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_findAttributeIndexByName ( DatabaseHandle  db,
AttributeSetId  setId,
const char *  attributeName,
AttributeIndex index 
)

Get database attribute table index using the attributeSet id and attribute name

Parameters
[in]dbThe database handle
[in]setIdThe attributeSet identifier
[in]attributeNameThe attribute name
[out]indexOutput the attribute's table index of this attributeSet
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_findAttributeSetId ( DatabaseHandle  db,
const char *  setName,
AttributeSetId setId 
)

Get unique attributeSet identifier using the attributeSet name

Parameters
[in]dbThe database handle
[in]setNameThe attributeSet name
[out]setIdOutput the attributeSet identifier
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_getClientId ( InstanceHandle  inst,
ClientId clientIdPtr 
)

Get the owning client identifier of an instance

Parameters
[in]instThe instance handle
[out]clientIdPtrOutput the client id of this instance
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_getDatabaseHandleForInstance ( InstanceHandle  inst,
DatabaseHandle dbHandle 
)

Get instance identifier from instance's global Id

Parameters
[in]instThe instance handle of an entity
[out]dbHandleReturns the database handle
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_getGlobalId ( InstanceHandle  inst,
GlobalId gidPtr 
)

Get the Global identifier of an instance

Parameters
[in]instThe instance handle
[out]gidPtrOutput the global identifier
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_getInstanceId ( DatabaseHandle  db,
GlobalId  globalId,
InstanceHandle handlePtr 
)

Get instance identifier from instance's global Id

Parameters
[in]dbThe database handle
[in]globalIdThe global identifier of an instance
[out]handlePtrReturns the instance handle of this GlobalId instance
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_inFrame ( DatabaseHandle  db,
LEG_Bool inFrame 
)

Check if the database is in a frame, in between the DB beginFrame and endFrame calls

Parameters
[in]dbThe database handle
[out]inFrameReturn true if it's inFrame, false if it's not
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_isValid ( InstanceHandle  inst,
LEG_Bool isValid 
)

Check if an instance handle is valid

Parameters
[in]instThe instance handle
[out]isValidAn output flag indicates whether the database is valid
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_registerAttribute ( DatabaseHandle  db,
AttributeSetId  setId,
const LEG_AttributeDescriptor descriptor,
AttributeIndex index 
)

Get unique attribute identifier using the attributeSet id and attribute name

Parameters
[in]dbThe database handle
[in]setIdThe attributeSet identifier
[in]descriptorThe attribute set descriptor
[out]indexOutput the attribute's table index of this attributeSet
See Also
LEG_AttributeDescriptor
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_registerAttributeSet ( DatabaseHandle  db,
const LEG_AttributeSetDescriptor setDesc,
AttributeSetId setId 
)

Register attribute set descriptor

Parameters
[in]dbThe database handle
[in]setDescThe attributeSet descriptor
[out]setIdThe attributeSet identifier
See Also
LEG_AttributeSetDescriptor
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_removeBeginFrameCallback ( DatabaseHandle  db,
C_BeginFrameCallback  func,
void *  usr 
)

Remove and unregister the callback function from getting invoked by database at DB begin frame

Parameters
[in]dbThe database handle
[in]funcA callback function to be registered
[in]usrUser data passed to the callback function
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_removeEndFrameCallback ( DatabaseHandle  db,
C_EndFrameCallback  func,
void *  usr 
)

Remove and unregister the callback function from getting invoked by database at DB end frame

Parameters
[in]dbThe database handle
[in]funcA callback function to be registered
[in]usrUser data passed to the callback function
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_reserve ( DatabaseHandle  db,
AttributeSetId  setType,
UInt32  count 
)

Reserve database for attribute set

Parameters
[in]dbThe database handle
[in]setTypeAn unique identifier of attributeSet
[in]countThe capacity count to reserve
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_setClientId ( DatabaseHandle  db,
ClientId  clientId 
)

Set client id

Parameters
[in]dbThe database handle
[out]clientIdReturn client identifier
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_setTypeForInstance ( InstanceHandle  inst,
UInt32 setType 
)

Get the attributeSet identifier of an instance

Parameters
[in]instThe instance handle
[out]setTypeThe set type of the instance identifier
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_simTime ( DatabaseHandle  db,
double *  simTime 
)

Get the current simulation time

Parameters
[in]dbThe database handle
[out]simTimeReturn simulation time
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_viewManager ( DatabaseHandle  db,
ViewManagerHandle viewManagerHandle 
)

Get view manager

Parameters
[in]dbThe database handle
[out]viewManagerHandleReturn view manager handle
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure

Document ID: Generated on Wed May 26 15:17:05 EDT 2021 from SVN revision 229676
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)