MAK Legion 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, UInt32 *clientId)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_setClientId (DatabaseHandle db, UInt32 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 AttributeSetId legion_db_registerAttributeSet (DatabaseHandle db, const LEG_AttributeSetDescriptor *setDesc)
 
LEGIONRUNTIME_DLL AttributeSetId legion_db_findAttributeSetId (DatabaseHandle db, const char *setName)
 
LEGIONRUNTIME_DLL AttributeId legion_db_registerAttribute (DatabaseHandle db, AttributeSetId setId, const LEG_AttributeDescriptor *set)
 
LEGIONRUNTIME_DLL AttributeIndex legion_db_findAttributeIndexByName (DatabaseHandle db, AttributeSetId setId, const char *attributeName)
 
LEGIONRUNTIME_DLL AttributeIndex legion_db_findAttributeIndexById (DatabaseHandle db, AttributeSetId setId, UInt32 attrId)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_createInstance (DatabaseHandle db, AttributeSetId setId, InstanceHandle *handle)
 
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_destroyInstance (DatabaseHandle db, InstanceHandle inst)
 
LEGIONRUNTIME_DLL UInt32 legion_db_setTypeForInstance (InstanceHandle inst)
 
LEGIONRUNTIME_DLL GlobalId legion_db_getGlobalId (InstanceHandle inst)
 
LEGIONRUNTIME_DLL ClientId legion_db_getClientId (InstanceHandle inst)
 
LEGIONRUNTIME_DLL UInt32 legion_db_isValid (InstanceHandle inst)
 
LEGIONRUNTIME_DLL UInt64 legion_db_getInstanceId (DatabaseHandle db, GlobalId globalId)
 

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 fuction 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 fuction 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, one of the most impartant function

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,
UInt32 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]handleReturn 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().

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 ( DatabaseHandle  db,
InstanceHandle  inst 
)

Delete an instance of attributeSet

Parameters
[in]dbThe database handle
[in]setIdThe attributeSet identifier
[in]handleThe 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, one of the most impartant function

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 AttributeIndex legion_db_findAttributeIndexById ( DatabaseHandle  db,
AttributeSetId  setId,
UInt32  attrId 
)

Get unique attribute identifier using the attributeSet id and attribuye id

Parameters
[in]dbThe database handle
[in]setIdThe attributeSet identifier
[in]attributeIdThe attribute identifier
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL AttributeIndex legion_db_findAttributeIndexByName ( DatabaseHandle  db,
AttributeSetId  setId,
const char *  attributeName 
)

Get unique attribute identifier using the attributeSet id and attribuye name

Parameters
[in]dbThe database handle
[in]setIdThe attributeSet identifier
[in]attributeNameThe attribute name
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL AttributeSetId legion_db_findAttributeSetId ( DatabaseHandle  db,
const char *  setName 
)

Get unique attributeSet identifier using the attributeSet name

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

Get the owning client identifier of an instance

Parameters
[in]handleThe instance handle
Returns
ClientId Return client id of this instance
LEGIONRUNTIME_DLL GlobalId legion_db_getGlobalId ( InstanceHandle  inst)

Get the Global identifier of an instance

Parameters
[in]handleThe instance handle
Returns
GlobalId Return the global identifier
LEGIONRUNTIME_DLL UInt64 legion_db_getInstanceId ( DatabaseHandle  db,
GlobalId  globalId 
)

Get instance identifier from instance's gloable Id

Parameters
[in]dbThe database handle
[in]GlobalIdThe global identifier of an instance
Returns
UInt64 Return instance id
LEGIONRUNTIME_DLL LEG_ReturnCode legion_db_inFrame ( DatabaseHandle  db,
LEG_Bool inFrame 
)

Check if it's 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 UInt32 legion_db_isValid ( InstanceHandle  inst)

Check if an instance handle is valid

LEGIONRUNTIME_DLL AttributeId legion_db_registerAttribute ( DatabaseHandle  db,
AttributeSetId  setId,
const LEG_AttributeDescriptor set 
)

Get unique attribute identifier using the attributeSet id and attribuye name

Parameters
[in]dbThe database handle
[in]setIdThe attributeSet identifier
[in]attributeNameThe attribute name
See Also
LEG_AttributeDescriptor
Returns
LEG_ReturnCode 0 indicates success, non 0 error code indicates failure
LEGIONRUNTIME_DLL AttributeSetId legion_db_registerAttributeSet ( DatabaseHandle  db,
const LEG_AttributeSetDescriptor setDesc 
)

Register attribute set descriptor

Parameters
[in]dbThe database handle
[in]setDescThe attributeSet descriptor
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 fuction 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 fuction 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,
UInt32  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 UInt32 legion_db_setTypeForInstance ( InstanceHandle  inst)

Get the attributeSet identifier of an instance

Parameters
[in]handleThe instance handle
Returns
UInt32 Returns the attributeSet identifier
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 Mon Mar 8 15:11:30 EST 2021 from SVN revision 225633
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)