MIP SDK — C++ 1.18
API Reference Documentation for C++
Loading...
Searching...
No Matches
PolicyProfile::Settings Class Reference

Settings used by PolicyProfile during its creation and throughout its lifetime. More...

#include <mip/upe/policy_profile.h>

Public Member Functions

 Settings (const std::shared_ptr< MipContext > &mipContext, CacheStorageType cacheStorageType, const std::shared_ptr< PolicyProfile::Observer > &observer)
 Interface for configuring the profile.
 
CacheStorageType GetCacheStorageType () const
 Get whether caches are stored in memory or on disk.
 
const std::shared_ptr< PolicyProfile::Observer > & GetObserver () const
 Get the event observer.
 
std::shared_ptr< MipContextGetMipContext () const
 Get MIP context which represents shared state across all profiles.
 
std::shared_ptr< HttpDelegateGetHttpDelegate () const
 Get the HTTP delegate (if any) provided by the application.
 
void SetHttpDelegate (const std::shared_ptr< HttpDelegate > &httpDelegate)
 Override default HTTP stack with client's own.
 
std::shared_ptr< StorageDelegateGetStorageDelegate () const
 Get the StorageDelegate (if any) provided by the application.
 
void SetStorageDelegate (const std::shared_ptr< StorageDelegate > &storageDelegate)
 Override default storage cache with client's own implementation.
 
std::shared_ptr< TaskDispatcherDelegateGetTaskDispatcherDelegate () const
 Get the TaskDispatcher delegate (if any) provided by the application.
 
void SetTaskDispatcherDelegate (const std::shared_ptr< TaskDispatcherDelegate > &taskDispatcherDelegate)
 Override default asynchronous task dispatching handling with client's own.
 
void SetSessionId (const std::string &sessionId)
 
const std::string & GetSessionId () const
 
void SetCustomSettings (const std::vector< std::pair< std::string, std::string > > &customSettings)
 Set the custom settings, used for feature gating and testing.
 
const std::vector< std::pair< std::string, std::string > > & GetCustomSettings () const
 Get the custom settings, used for feature gating and testing.
 
const std::shared_ptr< void > & GetLoggerContext () const
 Get logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.
 
void SetLoggerContext (const std::shared_ptr< void > &loggerContext)
 Sets the logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.
 
 ~Settings ()
 

Private Attributes

std::shared_ptr< MipContextmMipContext
 
CacheStorageType mCacheStorageType
 
std::shared_ptr< PolicyProfile::ObservermObserver
 
std::shared_ptr< HttpDelegatemHttpDelegate
 
std::shared_ptr< TaskDispatcherDelegatemTaskDispatcherDelegate
 
std::string mSessionId
 
std::vector< std::pair< std::string, std::string > > mCustomSettings
 
std::shared_ptr< void > mLoggerContext
 
std::shared_ptr< StorageDelegatemStorageDelegate
 

Detailed Description

Settings used by PolicyProfile during its creation and throughout its lifetime.

Constructor & Destructor Documentation

◆ Settings()

PolicyProfile::Settings::Settings ( const std::shared_ptr< MipContext > & mipContext,
CacheStorageType cacheStorageType,
const std::shared_ptr< PolicyProfile::Observer > & observer )
inline

Interface for configuring the profile.

Parameters
mipContextGlobal context settings
cacheStorageTypeStore any cached state in memory or on disk, ignored if cacheStorageType is specified in MipConfiguration
observerA class implementing the PolicyProfile::Observer interface. Can be nullptr.

◆ ~Settings()

PolicyProfile::Settings::~Settings ( )
inline

Member Function Documentation

◆ GetCacheStorageType()

CacheStorageType PolicyProfile::Settings::GetCacheStorageType ( ) const
inline

Get whether caches are stored in memory or on disk.

Returns
storage type used

◆ GetCustomSettings()

const std::vector< std::pair< std::string, std::string > > & PolicyProfile::Settings::GetCustomSettings ( ) const
inline

Get the custom settings, used for feature gating and testing.

Returns
List of name/value pairs.

◆ GetHttpDelegate()

std::shared_ptr< HttpDelegate > PolicyProfile::Settings::GetHttpDelegate ( ) const
inline

Get the HTTP delegate (if any) provided by the application.

Returns
Http delegate to be used for HTTP operations

◆ GetLoggerContext()

const std::shared_ptr< void > & PolicyProfile::Settings::GetLoggerContext ( ) const
inline

Get logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.

Returns
The logger context

◆ GetMipContext()

std::shared_ptr< MipContext > PolicyProfile::Settings::GetMipContext ( ) const
inline

Get MIP context which represents shared state across all profiles.

Returns
MIP context

◆ GetObserver()

const std::shared_ptr< PolicyProfile::Observer > & PolicyProfile::Settings::GetObserver ( ) const
inline

Get the event observer.

Returns
the event observer.

◆ GetSessionId()

const std::string & PolicyProfile::Settings::GetSessionId ( ) const
inline

◆ GetStorageDelegate()

std::shared_ptr< StorageDelegate > PolicyProfile::Settings::GetStorageDelegate ( ) const
inline

Get the StorageDelegate (if any) provided by the application.

Returns
StorageDelegate to be used for cache operations

◆ GetTaskDispatcherDelegate()

std::shared_ptr< TaskDispatcherDelegate > PolicyProfile::Settings::GetTaskDispatcherDelegate ( ) const
inline

Get the TaskDispatcher delegate (if any) provided by the application.

Returns
TaskDispatcher delegate to be used for executing asynchronous tasks

◆ SetCustomSettings()

void PolicyProfile::Settings::SetCustomSettings ( const std::vector< std::pair< std::string, std::string > > & customSettings)
inline

Set the custom settings, used for feature gating and testing.

Parameters
customSettingsList of name/value pairs.

◆ SetHttpDelegate()

void PolicyProfile::Settings::SetHttpDelegate ( const std::shared_ptr< HttpDelegate > & httpDelegate)
inline

Override default HTTP stack with client's own.

Parameters
httpDelegateHttp callback interface implemented by client application

◆ SetLoggerContext()

void PolicyProfile::Settings::SetLoggerContext ( const std::shared_ptr< void > & loggerContext)
inline

Sets the logger context that will be opaquely passed to the logger delegate for logs associated with the created profile.

Parameters
loggerContextThe logger context

◆ SetSessionId()

void PolicyProfile::Settings::SetSessionId ( const std::string & sessionId)
inline

◆ SetStorageDelegate()

void PolicyProfile::Settings::SetStorageDelegate ( const std::shared_ptr< StorageDelegate > & storageDelegate)
inline

Override default storage cache with client's own implementation.

Parameters
storageDelegateStorageDelegate implemented by client application

◆ SetTaskDispatcherDelegate()

void PolicyProfile::Settings::SetTaskDispatcherDelegate ( const std::shared_ptr< TaskDispatcherDelegate > & taskDispatcherDelegate)
inline

Override default asynchronous task dispatching handling with client's own.

Parameters
taskDispatcherDelegateTask dispatching callback interface implemented by client application
Note
tasks can reference profile objects preventing its destruction as a result taskdispatcher queues should not be shared.

Member Data Documentation

◆ mCacheStorageType

CacheStorageType PolicyProfile::Settings::mCacheStorageType
private

◆ mCustomSettings

std::vector<std::pair<std::string, std::string> > PolicyProfile::Settings::mCustomSettings
private

◆ mHttpDelegate

std::shared_ptr<HttpDelegate> PolicyProfile::Settings::mHttpDelegate
private

◆ mLoggerContext

std::shared_ptr<void> PolicyProfile::Settings::mLoggerContext
private

◆ mMipContext

std::shared_ptr<MipContext> PolicyProfile::Settings::mMipContext
private

◆ mObserver

std::shared_ptr<PolicyProfile::Observer> PolicyProfile::Settings::mObserver
private

◆ mSessionId

std::string PolicyProfile::Settings::mSessionId
private

◆ mStorageDelegate

std::shared_ptr<StorageDelegate> PolicyProfile::Settings::mStorageDelegate
private

◆ mTaskDispatcherDelegate

std::shared_ptr<TaskDispatcherDelegate> PolicyProfile::Settings::mTaskDispatcherDelegate
private

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