Class CSPFoundation

Class Documentation

class CSPFoundation

Main entry point for interacting with Foundation.

Provides functionality for initialising, shutting down and managing essential information for the Foundation instance to run.

Public Static Functions

static bool Initialise(const csp::common::String &EndpointRootURI, const csp::common::String &Tenant)

Sets the endpoints for the various services needed for foundation, passes over the client header information and initialises the systems required for foundation to operate.

Parameters
  • EndpointRootURIcsp::common::String : Root URI for service endpoints

  • Tenantcsp::common::String : Tenant for Magnopus Services. Data is not shared between tenants so clients using separate tenants cannot interact with each other.

Returns

bool : True for successful initialisation.

static bool Shutdown()

This should be used at the end of the application lifecycle.

Clears event queues and destroys foundation systems. After shutdown, no other Foundation functions should be called until Initialise is called again.

Returns

bool : True for successful shutdown

static void Tick()

Ticks the event processing of foundation.

This should only be called once per frame from the client application.

static const csp::common::String &GetVersion()

Gets the foundation version in use.

Returns

const csp::common::String& : Returns the commit hash for the foundation build

static const csp::common::String &GetBuildType()

Gets the foundation build type in use.

Returns

const csp::common::String& : Returns the build type for the foundation build (DEV or REL)

static const csp::common::String &GetBuildID()

Gets the full foundation build ID in use.

Generated at project generation time using the lastest commit timestamp and hash.

Returns

const csp::common::String : Returns the build ID for the foundation build

static const csp::common::String &GetDeviceId()

Unique identifier for the current device.

Used internally by certain user authentication endpoints.

Returns

csp::common::String& : A string representing the current device

static bool GetIsInitialised()

Is this instance of Foundation initialised.

Returns

bool : Returns false before Initialise and after Shutdown

static const EndpointURIs &GetEndpoints()

Gets endpoints used for all Magnopus service.

Used internally to setup all System classes.

Returns

const EndpointURIs& : The EndpointURIs class with current endpoint data

static void SetClientUserAgentInfo(const csp::ClientUserAgent &ClientUserAgentHeader)

Sets a class containing all relevant Client info currently set for Foundation.

Used internally to generate ClientUserAgentString.

Parameters

The – Client Info class with current Client Info data

static const ClientUserAgent &GetClientUserAgentInfo()

Gets a class containing all relevant Client info currently set for Foundation.

Returns

const ClientUserAgent& : The Client Info class with current Client Info data

static const csp::common::String &GetClientUserAgentString()

Gets a string containing the Client UserAgent header information.

Used internally in headers for all Magnopus Service requests.

Returns

csp::common::String& : Returns Client UserAgent header

static const csp::common::String &GetTenant()

Gets the tenant that foundation is currently using, based on what was provided during initialisation.

Returns

csp::common::String&