![]() |
RAMSES Documentation
27.0.130
Information for RAMSES users and developers
|
Class representing ramses framework components that are needed to initialize an instance of ramses client and renderer. More...
#include <RamsesFramework.h>
Public Member Functions | |
RamsesFramework () | |
Default constructor. More... | |
RamsesFramework (int32_t argc, char const *const *argv) | |
Constructor of RamsesFramework using command line parameters. More... | |
RamsesFramework (const RamsesFrameworkConfig &config) | |
Constructor of RamsesFramework using RamsesFrameworkConfig object. More... | |
status_t | connect () |
Tries to establish a connection to the RAMSES system. More... | |
bool | isConnected () const |
Check if the RamsesClient is connected or not. More... | |
status_t | disconnect () |
Disconnects the RamsesClient from the system. More... | |
RamsesClient * | createClient (const char *applicationName) |
Create a new RamsesClient linked to this framework. Creation of multiple clients is supported. It might be disallowed to create any client depending on internal policy. Ownership of the client will remain with the framework. More... | |
status_t | destroyClient (RamsesClient &client) |
Destroy a RamsesClient created with this framework. This method will fail when handed an object created with another RamsesFramework. More... | |
RamsesRenderer * | createRenderer (const RendererConfig &config) |
Create a new RamsesRenderer linked to this framework. Only one RamsesRenderer can exist per RamsesFramework instance. It might be disallowed to create any renderer depending on internal policy. Ownership of the renderer will remain with the framework. More... | |
status_t | destroyRenderer (RamsesRenderer &renderer) |
Destroy a RamsesRenderer created with this framework. This method will fail when handed an object created with another RamsesFramework. More... | |
DcsmProvider * | createDcsmProvider () |
Create a new DcsmProvider linked to this framework. Only one DcsmProvider can exist per RamsesFramework instance. Depending on user the creation is not allowed and will always fail. More... | |
status_t | destroyDcsmProvider (const DcsmProvider &provider) |
Destroy a DcsmProvider created with this framework. This method will fail when handed an object created with another RamsesFramework. Ownership of the provider will remain with the framework. More... | |
DcsmConsumer * | createDcsmConsumer () |
Create a new DcsmConsumer linked to this framework. Only one DcsmConsumer can exist per RamsesFramework instance. It might be disallowed to create any consumer depending on internal policy. Ownership of the consumer will remain with the framework. More... | |
status_t | destroyDcsmConsumer (const DcsmConsumer &consumer) |
Destroy a DcsmConsumer created with this framework. This method will fail when handed an object created with another RamsesFramework. More... | |
status_t | addRamshCommand (const std::shared_ptr< IRamshCommand > &command) |
Register a ramsh command that can be invoked via console and DLT injection. More... | |
status_t | executeRamshCommand (const std::string &input) |
Execute a ramsh command programmatically. More... | |
~RamsesFramework () override | |
Destructor of RamsesFramework. More... | |
RamsesFramework (const RamsesFramework &other)=delete | |
Deleted copy constructor. More... | |
RamsesFramework & | operator= (const RamsesFramework &other)=delete |
Deleted copy assignment. More... | |
![]() | |
status_t | validate () const |
Generates verbose validation of the object. More... | |
const char * | getValidationReport (EValidationSeverity minSeverity=EValidationSeverity_Info) const |
Provides verbose report in human readable form generated by validate. More... | |
const char * | getStatusMessage (status_t status) const |
Get the string description for a status provided by a RAMSES API function. More... | |
StatusObject (const StatusObject &other)=delete | |
Deleted copy constructor. More... | |
StatusObject & | operator= (const StatusObject &other)=delete |
Deleted copy assignment. More... | |
Static Public Member Functions | |
static void | SetConsoleLogLevel (ELogLevel logLevel) |
Set the log level for all console log messages and apply it immediately. More... | |
static void | SetLogHandler (const LogHandlerFunc &logHandlerFunc) |
static uint64_t | GetSynchronizedClockMilliseconds () |
Public Attributes | |
class RamsesFrameworkImpl & | impl |
![]() | |
class StatusObjectImpl & | impl |
Additional Inherited Members | |
![]() | |
StatusObject (StatusObjectImpl &pimpl) | |
Constructor for StatusObject. More... | |
virtual | ~StatusObject () |
Destructor of the StatusObject. More... | |
Class representing ramses framework components that are needed to initialize an instance of ramses client and renderer.
ramses::RamsesFramework::RamsesFramework | ( | ) |
Default constructor.
ramses::RamsesFramework::RamsesFramework | ( | int32_t | argc, |
char const *const * | argv | ||
) |
Constructor of RamsesFramework using command line parameters.
[in] | argc | Number of strings in argv array |
[in] | argv | Command line parameters as array of string |
|
explicit |
Constructor of RamsesFramework using RamsesFrameworkConfig object.
[in] | config | Configuration object |
|
override |
Destructor of RamsesFramework.
This will destroy all objects created with this RamsesFramework instance (RamsesRenderer, RamsesClient, DcsmProvider, DcsmConsumer), so there is no general need to explicitly destroy these objects individually, if not specifically intended to do so.
|
delete |
Deleted copy constructor.
other | unused |
status_t ramses::RamsesFramework::addRamshCommand | ( | const std::shared_ptr< IRamshCommand > & | command | ) |
Register a ramsh command that can be invoked via console and DLT injection.
This is for testing and debugging purpose only. Command injection is not guaranteed to work in production.
The command has to be provided via shared_ptr to avoid lifetime issues. Internally ramses will only store a std::weak_ptr to the command. Therefore it is valid to let go of the shared_ptr on caller side and expect that no calls will happen in the command anymore. This allows to have user object references in the command implementation with a shorter lifetime than RamsesFramework.
It is not possible to delete commands. They are expected to be long-living and are bound to the lifetime of the RamsesFramework object.
[in] | command | the ramsh command |
status_t ramses::RamsesFramework::connect | ( | ) |
Tries to establish a connection to the RAMSES system.
If only local rendering is desired this does not need to be called - but all scenes must be published in ramses::EScenePublicationMode_LocalOnly.
RamsesClient* ramses::RamsesFramework::createClient | ( | const char * | applicationName | ) |
Create a new RamsesClient linked to this framework. Creation of multiple clients is supported. It might be disallowed to create any client depending on internal policy. Ownership of the client will remain with the framework.
Must create all client instances before calling connect().
The created instance is valid until destroyClient() is called or it will be automatically deleted in the RamsesFramework destructor.
applicationName | a name for the ramses client application |
DcsmConsumer* ramses::RamsesFramework::createDcsmConsumer | ( | ) |
Create a new DcsmConsumer linked to this framework. Only one DcsmConsumer can exist per RamsesFramework instance. It might be disallowed to create any consumer depending on internal policy. Ownership of the consumer will remain with the framework.
Must call connect() before communication with remote Dcsm providers is possible.
The created instance is valid until destroyDcsmConsumer() is called or it will be automatically deleted in the RamsesFramework destructor.
DcsmProvider* ramses::RamsesFramework::createDcsmProvider | ( | ) |
Create a new DcsmProvider linked to this framework. Only one DcsmProvider can exist per RamsesFramework instance. Depending on user the creation is not allowed and will always fail.
Must call connect() before communication with remote Dcsm consumers is possible.
The created instance is valid until destroyDcsmProvider() is called or it will be automatically deleted in the RamsesFramework destructor.
RamsesRenderer* ramses::RamsesFramework::createRenderer | ( | const RendererConfig & | config | ) |
Create a new RamsesRenderer linked to this framework. Only one RamsesRenderer can exist per RamsesFramework instance. It might be disallowed to create any renderer depending on internal policy. Ownership of the renderer will remain with the framework.
Must create the renderer object before calling connect().
The created instance is valid until destroyRenderer() is called or it will be automatically deleted in the RamsesFramework destructor.
config | Set of configuration flags and attributes for the ramses renderer |
status_t ramses::RamsesFramework::destroyClient | ( | RamsesClient & | client | ) |
Destroy a RamsesClient created with this framework. This method will fail when handed an object created with another RamsesFramework.
May not be called when connected.
client | the object to destroy |
status_t ramses::RamsesFramework::destroyDcsmConsumer | ( | const DcsmConsumer & | consumer | ) |
Destroy a DcsmConsumer created with this framework. This method will fail when handed an object created with another RamsesFramework.
consumer | the object to destroy |
status_t ramses::RamsesFramework::destroyDcsmProvider | ( | const DcsmProvider & | provider | ) |
Destroy a DcsmProvider created with this framework. This method will fail when handed an object created with another RamsesFramework. Ownership of the provider will remain with the framework.
provider | the object to destroy |
status_t ramses::RamsesFramework::destroyRenderer | ( | RamsesRenderer & | renderer | ) |
Destroy a RamsesRenderer created with this framework. This method will fail when handed an object created with another RamsesFramework.
May not be called when connected.
renderer | the object to destroy |
status_t ramses::RamsesFramework::disconnect | ( | ) |
Disconnects the RamsesClient from the system.
status_t ramses::RamsesFramework::executeRamshCommand | ( | const std::string & | input | ) |
Execute a ramsh command programmatically.
Instead of typing the command in ramsh console or using DLT injection this function enables the user to execute a ramsh command in code. The input is a string that contains the command and args. For setting the consoleLogLevel the input string with command and argument would be: "setLogLevelConsole trace".
[in] | input | a a string containing the ramsh command and args |
|
static |
Gets the current value of the synchronized clock in milliseconds
The synchronized clock is a common time source shared between ramses client and renderer. Its implementation is system dependent. In the simplest case it refers to the system clock. On systems with different ECUs it may refer to an external time source (ptp time). Both renderer and client ECUs need to be built with the same type of synchronized clock.
The synchronized clock is used for the scene expiration mechanism (ramses::Scene::setExpirationTimestamp)
bool ramses::RamsesFramework::isConnected | ( | ) | const |
Check if the RamsesClient is connected or not.
|
delete |
Deleted copy assignment.
other | unused |
|
static |
Set the log level for all console log messages and apply it immediately.
If this function is called before creation of RamsesFramework it will be overwritten by cmdl args ("log-level", "log-level-console"), environment variable ("RAMSES_LOGLEVEL") and by dynamically injected value by ramsh or dlt viewer/logger. If this function is called after creation of RamsesFramework it can only be overwritten dynamically by ramsh or dlt viewer/logger.
[in] | logLevel | the log level to be applied |
|
static |
Sets a custom log handler function, which is called each time a log message occurs. All messages will still be logged to the regular sinks (dlt, console)
@ param logHandlerFunc function which is called for each log message Set to nullptr to delete the handler
Note: the logHandlerFunc will be called from inside ramses internal code, and it must return quickly and not block, otherwise it will break the ramses internal rendering or distribution logic.
Additional restrictions:
class RamsesFrameworkImpl& ramses::RamsesFramework::impl |
Stores internal data for implementation specifics of RamsesFramework