Overview
Core API functions are non-contract; that is, they may fail and return an error code, so the caller must check the return code. More succinct code is achieved in C++ by offering "contract" functions, that either succeed or raise an exception. Contract wrapper functions are provided for some Core API functions in the overlay.
Functions
These are "contract" functions; that is, they either succeed or raise an exception. If you are upgrading from 1065, note that the only difference in any of these functions is that none of them take the hCaller argument anymore - this is inserted for you by the binding.
- void assertClass(
Symbol hData, const char* cls, UINT16 release = 0) - Contract wrapper for brahms_getComponentInfo. This function does nothing if
hData is of the specified class, and of at least the specified release. In any other case, it raises an exception. You should not pass the release parameter unless you really need an extended interface, since this will prevent your process from receiving input from Data objects at earlier releases.
- const char* getSymbolString(
Symbol symbol) - Contract wrapper for
brahms_getSymbolString (which, as it happens, can't fail anyway).
- const char* getElementTypeString(
TYPE type) - Contract wrapper for
brahms_getElementTypeString (which, as it happens, can't fail anyway).
VUINT32 getRandomSeed(UINT32 count = 0)- Contract wrapper for
brahms_getRandomSeed. If count is zero, a seed of unspecified length is returned (at least one element). If count is non-zero, a seed of the specified length is returned.
ComponentInfo getComponentInfo(Symbol hComponent)- Contract wrapper for brahms_getComponentInfo. Information on the specified component is returned.
ComponentData getComponentData(Symbol hComponent)- Contract wrapper for brahms_getComponentData. Data on the specified component is returned.
Symbol createUtility(const char* cls, UINT16 release, const char* name = NULL)- Contract wrapper for
brahms_createUtility. A utility, as specified, is returned. If name is non-NULL, the new utility is named accordingly.
Symbol sendSignal(Symbol signal, void* data)- Send the specified signal to the framework and return the result (see
brahms_sendSignal).
DOUBLE readWallclock()- Read the wallclock (send
C_READ_WALLCLOCK) and return the result.
|