RAMSES Documentation  27.0.130
Information for RAMSES users and developers
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
ramses::RamsesFramework Class Reference

Class representing ramses framework components that are needed to initialize an instance of ramses client and renderer. More...

#include <RamsesFramework.h>

Inheritance diagram for ramses::RamsesFramework:
[legend]
Collaboration diagram for ramses::RamsesFramework:
[legend]

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...
 
RamsesClientcreateClient (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...
 
RamsesRenderercreateRenderer (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...
 
DcsmProvidercreateDcsmProvider ()
 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...
 
DcsmConsumercreateDcsmConsumer ()
 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...
 
RamsesFrameworkoperator= (const RamsesFramework &other)=delete
 Deleted copy assignment. More...
 
- Public Member Functions inherited from ramses::StatusObject
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...
 
StatusObjectoperator= (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
 
- Public Attributes inherited from ramses::StatusObject
class StatusObjectImpl & impl
 

Additional Inherited Members

- Protected Member Functions inherited from ramses::StatusObject
 StatusObject (StatusObjectImpl &pimpl)
 Constructor for StatusObject. More...
 
virtual ~StatusObject ()
 Destructor of the StatusObject. More...
 

Detailed Description

Class representing ramses framework components that are needed to initialize an instance of ramses client and renderer.

Examples
ramses-example-basic-animation-realtime/src/main.cpp, ramses-example-basic-animation/src/main.cpp, ramses-example-basic-blending/src/main.cpp, ramses-example-basic-compositing/src/main.cpp, ramses-example-basic-effect-from-glsl/src/main.cpp, ramses-example-basic-file-loading/src/main.cpp, ramses-example-basic-geometry/src/main.cpp, ramses-example-basic-rendergroups/src/main.cpp, ramses-example-basic-renderpasses/src/main.cpp, ramses-example-basic-rendertarget/src/main.cpp, ramses-example-basic-scenegraph/src/main.cpp, ramses-example-basic-texturing/src/main.cpp, ramses-example-data-buffers-texture/src/main.cpp, ramses-example-data-buffers-vertices/src/main.cpp, ramses-example-dcsm-provider/src/main.cpp, ramses-example-geometry-instancing/src/main.cpp, ramses-example-interleaved-vertex-buffers/src/main.cpp, ramses-example-local-client-dcsm/src/main.cpp, ramses-example-local-client/src/main.cpp, ramses-example-local-datalink/src/main.cpp, ramses-example-local-displays/src/main.cpp, ramses-example-local-dma-offscreenbuffer/src/main.cpp, ramses-example-local-geometry-shaders/src/main.cpp, ramses-example-local-offscreenbuffer/src/main.cpp, ramses-example-local-pick-handling/src/main.cpp, ramses-example-local-scene-referencing/src/main.cpp, ramses-example-local-viewport-link/src/main.cpp, ramses-example-minimal/src/main.cpp, ramses-example-renderonce/src/main.cpp, ramses-example-text-basic/src/main.cpp, and ramses-example-text-languages/src/main.cpp.

Constructor & Destructor Documentation

◆ RamsesFramework() [1/4]

ramses::RamsesFramework::RamsesFramework ( )

Default constructor.

◆ RamsesFramework() [2/4]

ramses::RamsesFramework::RamsesFramework ( int32_t  argc,
char const *const *  argv 
)

Constructor of RamsesFramework using command line parameters.

Parameters
[in]argcNumber of strings in argv array
[in]argvCommand line parameters as array of string

◆ RamsesFramework() [3/4]

ramses::RamsesFramework::RamsesFramework ( const RamsesFrameworkConfig config)
explicit

Constructor of RamsesFramework using RamsesFrameworkConfig object.

Parameters
[in]configConfiguration object

◆ ~RamsesFramework()

ramses::RamsesFramework::~RamsesFramework ( )
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.

◆ RamsesFramework() [4/4]

ramses::RamsesFramework::RamsesFramework ( const RamsesFramework other)
delete

Deleted copy constructor.

Parameters
otherunused

Member Function Documentation

◆ addRamshCommand()

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.

Parameters
[in]commandthe ramsh command
Returns
StatusOK on success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ connect()

status_t ramses::RamsesFramework::connect ( )

◆ createClient()

RamsesClient* ramses::RamsesFramework::createClient ( const char *  applicationName)

◆ createDcsmConsumer()

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.

Returns
The new DcsmConsumer object or nullptr if the creation failed or was denied.

◆ createDcsmProvider()

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.

Returns
The new DcsmProvider object or nullptr if the creation failed or was denied.

◆ createRenderer()

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.

Parameters
configSet of configuration flags and attributes for the ramses renderer
Returns
The new RamsesRenderer object or nullptr if the creation failed or was denied.

◆ destroyClient()

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.

Parameters
clientthe object to destroy
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ destroyDcsmConsumer()

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.

Parameters
consumerthe object to destroy
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ destroyDcsmProvider()

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.

Parameters
providerthe object to destroy
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ destroyRenderer()

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.

Parameters
rendererthe object to destroy
Returns
StatusOK for success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ disconnect()

status_t ramses::RamsesFramework::disconnect ( )

◆ executeRamshCommand()

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".

Parameters
[in]inputa a string containing the ramsh command and args
Returns
StatusOK on success, otherwise the returned status can be used to resolve error message using getStatusMessage().

◆ GetSynchronizedClockMilliseconds()

static uint64_t ramses::RamsesFramework::GetSynchronizedClockMilliseconds ( )
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)

Returns
current time point of synchronized clock in milliseconds

◆ isConnected()

bool ramses::RamsesFramework::isConnected ( ) const

Check if the RamsesClient is connected or not.

Returns
true if connected, false otherwise.

◆ operator=()

RamsesFramework& ramses::RamsesFramework::operator= ( const RamsesFramework other)
delete

Deleted copy assignment.

Parameters
otherunused
Returns
unused

◆ SetConsoleLogLevel()

static void ramses::RamsesFramework::SetConsoleLogLevel ( ELogLevel  logLevel)
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.

Parameters
[in]logLevelthe log level to be applied

◆ SetLogHandler()

static void ramses::RamsesFramework::SetLogHandler ( const LogHandlerFunc logHandlerFunc)
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:

  1. logHandlerFunc will be called from multiple threads and has to be thread safe
  2. logHandlerFunc may never call back into ramses code
  3. this method should not be used in target code, it is only for testing and tooling

Member Data Documentation

◆ impl

class RamsesFrameworkImpl& ramses::RamsesFramework::impl

Stores internal data for implementation specifics of RamsesFramework


The documentation for this class was generated from the following file: