WSF
SOSM_Manager Class Reference

A singleton class that manages SOSM data. More...

#include <SOSM_Manager.hpp>

Collaboration diagram for SOSM_Manager:

Public Member Functions

 SOSM_Manager (const UtAtmosphere &aAtmosphere)
 ~SOSM_Manager ()
void Load (const std::string &aFileName)
void Load (UtInput &aInput)
bool ProcessInput (UtInput &aInput)
UtAtmosphere & GetUtAtmosphere ()
SOSM_AtmosphereAllocateDefaultAtmosphere ()
SOSM_SensorTargetAllocateSensorTargetPair (const std::string &aSensorType, const std::string &aTargetType)
SOSM_AtmosphereAllocateAtmosphere (const std::string &aTypeName)
SOSM_SensorAllocateSensor (const std::string &aTypeName)
SOSM_TargetAllocateTarget (const std::string &aTypeName)
SOSM_AtmosphereFindAtmosphereType (const std::string &aTypeName)
SOSM_SensorFindSensorType (const std::string &aTypeName)
SOSM_TargetFindTargetType (const std::string &aTypeName)
SOSM_AtmosphereLoadAtmosphereType (const std::string &aTypeName, const std::string &aFileName)
SOSM_AtmosphereLoadAtmosphereType (const std::string &aTypeName, const std::string &aCachePrefix, UtInput &aInput)
SOSM_SensorLoadSensorType (const std::string &aTypeName, const std::string &aFileName)
SOSM_SensorLoadSensorType (const std::string &aTypeName, const std::string &aCachePrefix, UtInput &aInput)
SOSM_TargetLoadTargetType (const std::string &aTypeName, const std::string &aFileName)
SOSM_TargetLoadTargetType (const std::string &aTypeName, const std::string &aCachePrefix, UtInput &aInput)
std::string & CacheDirectory ()
 Return the name of the cache directory.
bool IgnoreCacheFiles ()
 Indicate if cached binary files should be ignored.
bool WriteCacheFiles ()
 Indicate if cached binary files should be created.
bool ShowStatus ()
 Indicate if status messages should be shown during file loading.
bool UseFastDetectionMode ()
int DebugLevel ()
 Return the debug level (<= 0 if no debugging).
bool ShowIRIPP_Data ()
 Return true if IRIPP comparison data is to be shown.

Utility routines to assist is pre-allocation of fast-detection mode tables.

typedef std::map< std::string, SOSM_Atmosphere * > AtmosphereTypes
typedef std::map< std::string, SOSM_Sensor * > SensorTypes
typedef std::map< std::string, SOSM_Target * > TargetTypes
UtAtmosphere mUtAtmosphere
AtmosphereTypes mAtmosphereTypes
SensorTypes mSensorTypes
TargetTypes mTargetTypes
std::string mDefaultAtmosphereType
std::string mCacheDirectory
int mDebugLevel
bool mIgnoreCacheFiles
bool mWriteCacheFiles
bool mUseFastDetectionMode
bool mShowStatus
bool mShowIRIPP_Data
SOSM_TestCommandsmTestCommandsPtr
void GetSensorTypes (std::vector< std::string > &aTypes) const
void GetTargetTypes (std::vector< std::string > &aTypes) const
bool PreallocatePair (const std::string &aSensorType, const std::string &aTargetType)
bool PreallocateAllPairs ()
 SOSM_Manager (const SOSM_Manager &aSrc)
SOSM_Manager operator= (const SOSM_Manager &aRhs)=delete
std::string GetCachePrefix (const std::string &aFileName)
void LoadFromStream (UtInput &aInput)
void LoadType (SOSM_CoreBase *aTypePtr, UtInput &aInput)
bool ReadCommand (UtInput &aInput, std::string &aCommand)
void TestDriver (UtInput &aInput)

File referenced notification.

The following exists to provide the controlling simulation a method to receive notification when the model references a file.

UtCallbackListN< void(const std::string &)> FileReferenced
std::string CacheFileName (const std::string &aTextFileName, const std::string &aCachePrefix)

Detailed Description

A singleton class that manages SOSM data.

Member Typedef Documentation

◆ AtmosphereTypes

typedef std::map<std::string, SOSM_Atmosphere*> SOSM_Manager::AtmosphereTypes
protected

◆ SensorTypes

typedef std::map<std::string, SOSM_Sensor*> SOSM_Manager::SensorTypes
protected

◆ TargetTypes

typedef std::map<std::string, SOSM_Target*> SOSM_Manager::TargetTypes
protected

Constructor & Destructor Documentation

◆ SOSM_Manager() [1/2]

◆ ~SOSM_Manager()

SOSM_Manager::~SOSM_Manager ( )

◆ SOSM_Manager() [2/2]

SOSM_Manager::SOSM_Manager ( const SOSM_Manager & aSrc)
protected

References SOSM_Manager().

Member Function Documentation

◆ AllocateAtmosphere()

SOSM_Atmosphere * SOSM_Manager::AllocateAtmosphere ( const std::string & aTypeName)

Allocate an instance of an atmosphere object.

Parameters
aTypeNameThe name of the atmosphere type for which an instance is desired.
Returns
A pointer to the instance or 0 if an instance could not be created.

References SOSM_Atmosphere::Clone(), FindAtmosphereType(), and SOSM_CoreBase::Initialize().

Referenced by AllocateDefaultAtmosphere().

◆ AllocateDefaultAtmosphere()

SOSM_Atmosphere * SOSM_Manager::AllocateDefaultAtmosphere ( )

Return a pointer to a new instance of the default atmosphere.

Returns
A pointer to a new instance of the default atmosphere.
Note
The return value will be 0 if the default atmosphere could not be created. This is almost always a fatal error, but it is left to the caller to decide how to handle the situation.

References AllocateAtmosphere(), and mDefaultAtmosphereType.

◆ AllocateSensor()

SOSM_Sensor * SOSM_Manager::AllocateSensor ( const std::string & aTypeName)

Allocate an instance of an sensor object.

Parameters
aTypeNameThe name of the sensor type for which an instance is desired.
Returns
A pointer to the instance or 0 if an instance could not be created.

References SOSM_Sensor::Clone(), FindSensorType(), and SOSM_Sensor::Initialize().

◆ AllocateSensorTargetPair()

SOSM_SensorTarget * SOSM_Manager::AllocateSensorTargetPair ( const std::string & aSensorType,
const std::string & aTargetType )

Create a sensor/target pairing object for the specified sensor and target types.

Parameters
aSensorTypeThe type of the sensor.
aTargetTypeThe type of the target.
Returns
A pointer to the sensor/target pairing object.
Note
If either the sensor or target type has not been defined, the object will not be usable for detection purposes. The caller is responsible for checking that the sensor and target pointers are valid by ensuring that SOSM_SensorTarget::GetSensor() and SOSM_SensorTarget::GetTarget() both return non-zero values.

References SOSM_SensorTarget::Initialize().

Referenced by WsfSOSM_Sensor::SOSM_Mode::AttemptToDetect().

◆ AllocateTarget()

SOSM_Target * SOSM_Manager::AllocateTarget ( const std::string & aTypeName)

Allocate an instance of an target object.

Parameters
aTypeNameThe name of the target type for which an instance is desired.
Returns
A pointer to the instance or 0 if an instance could not be created.

References SOSM_Target::Clone(), FindTargetType(), and SOSM_Target::Initialize().

◆ CacheDirectory()

std::string & SOSM_Manager::CacheDirectory ( )
inline

Return the name of the cache directory.

References mCacheDirectory.

Referenced by CacheFileName().

◆ CacheFileName()

std::string SOSM_Manager::CacheFileName ( const std::string & aTextFileName,
const std::string & aCachePrefix )

Return the name of the cache file that is associated with an indicated text file. This will also ensure the cache directory is created.

References SOSM_Utility::BaseName(), CacheDirectory(), and SOSM_Utility::MakePath().

Referenced by SOSM_SpectralTable2D::Load(), and SOSM_SpectralTable3D::Load().

◆ DebugLevel()

int SOSM_Manager::DebugLevel ( )
inline

Return the debug level (<= 0 if no debugging).

References mDebugLevel.

◆ FindAtmosphereType()

SOSM_Atmosphere * SOSM_Manager::FindAtmosphereType ( const std::string & aTypeName)

References mAtmosphereTypes.

Referenced by AllocateAtmosphere().

◆ FindSensorType()

SOSM_Sensor * SOSM_Manager::FindSensorType ( const std::string & aTypeName)

◆ FindTargetType()

SOSM_Target * SOSM_Manager::FindTargetType ( const std::string & aTypeName)

References mTargetTypes.

Referenced by AllocateTarget().

◆ GetCachePrefix()

std::string SOSM_Manager::GetCachePrefix ( const std::string & aFileName)
protected

◆ GetSensorTypes()

void SOSM_Manager::GetSensorTypes ( std::vector< std::string > & aTypes) const

References mSensorTypes.

Referenced by PreallocateAllPairs().

◆ GetTargetTypes()

void SOSM_Manager::GetTargetTypes ( std::vector< std::string > & aTypes) const

References mTargetTypes.

Referenced by PreallocateAllPairs().

◆ GetUtAtmosphere()

UtAtmosphere & SOSM_Manager::GetUtAtmosphere ( )

References mUtAtmosphere.

◆ IgnoreCacheFiles()

bool SOSM_Manager::IgnoreCacheFiles ( )
inline

Indicate if cached binary files should be ignored.

References mIgnoreCacheFiles.

◆ Load() [1/2]

void SOSM_Manager::Load ( const std::string & aFileName)

Process a file containing SOSM commands.

Parameters
aFileNameThe name of the file to be processed.
Exceptions
Variousexceptions if an input error occurs.

References FileReferenced, and Load().

Referenced by Load().

◆ Load() [2/2]

void SOSM_Manager::Load ( UtInput & aInput)

Process a stream containing SOSM commands.

Parameters
aInputThe input stream to be processed.
Exceptions
Variousexceptions if an input error occurs.

References ProcessInput(), and ReadCommand().

◆ LoadAtmosphereType() [1/2]

SOSM_Atmosphere * SOSM_Manager::LoadAtmosphereType ( const std::string & aTypeName,
const std::string & aCachePrefix,
UtInput & aInput )

◆ LoadAtmosphereType() [2/2]

SOSM_Atmosphere * SOSM_Manager::LoadAtmosphereType ( const std::string & aTypeName,
const std::string & aFileName )

◆ LoadFromStream()

void SOSM_Manager::LoadFromStream ( UtInput & aInput)
protected

References LoadType(), and ReadCommand().

◆ LoadSensorType() [1/2]

SOSM_Sensor * SOSM_Manager::LoadSensorType ( const std::string & aTypeName,
const std::string & aCachePrefix,
UtInput & aInput )

◆ LoadSensorType() [2/2]

SOSM_Sensor * SOSM_Manager::LoadSensorType ( const std::string & aTypeName,
const std::string & aFileName )

◆ LoadTargetType() [1/2]

SOSM_Target * SOSM_Manager::LoadTargetType ( const std::string & aTypeName,
const std::string & aCachePrefix,
UtInput & aInput )

◆ LoadTargetType() [2/2]

SOSM_Target * SOSM_Manager::LoadTargetType ( const std::string & aTypeName,
const std::string & aFileName )

◆ LoadType()

void SOSM_Manager::LoadType ( SOSM_CoreBase * aTypePtr,
UtInput & aInput )
protected

◆ operator=()

SOSM_Manager SOSM_Manager::operator= ( const SOSM_Manager & aRhs)
protecteddelete

References GetCachePrefix(), and SOSM_Manager().

◆ PreallocateAllPairs()

bool SOSM_Manager::PreallocateAllPairs ( )

Pre-allocate all sensor/target fast detection mode tables (If fast detection mode enabled). This is typically used to ensure all data is pre-computed for real-time operation.

References GetSensorTypes(), GetTargetTypes(), ok, PreallocatePair(), and UseFastDetectionMode().

Referenced by ProcessInput().

◆ PreallocatePair()

bool SOSM_Manager::PreallocatePair ( const std::string & aSensorType,
const std::string & aTargetType )

References ok, and UseFastDetectionMode().

Referenced by PreallocateAllPairs(), and ProcessInput().

◆ ProcessInput()

◆ ReadCommand()

bool SOSM_Manager::ReadCommand ( UtInput & aInput,
std::string & aCommand )
protected

Referenced by Load(), and LoadFromStream().

◆ ShowIRIPP_Data()

bool SOSM_Manager::ShowIRIPP_Data ( )
inline

Return true if IRIPP comparison data is to be shown.

References mShowIRIPP_Data.

◆ ShowStatus()

bool SOSM_Manager::ShowStatus ( )
inline

Indicate if status messages should be shown during file loading.

References mShowStatus.

◆ TestDriver()

void SOSM_Manager::TestDriver ( UtInput & aInput)
protected

◆ UseFastDetectionMode()

bool SOSM_Manager::UseFastDetectionMode ( )
inline

Indicate if the 'fast detection mode' should be used. The 'fast detection model' uses pre-computed values which have already been spectrally integrated.

References mUseFastDetectionMode.

Referenced by PreallocateAllPairs(), and PreallocatePair().

◆ WriteCacheFiles()

bool SOSM_Manager::WriteCacheFiles ( )
inline

Indicate if cached binary files should be created.

References mWriteCacheFiles.

Member Data Documentation

◆ FileReferenced

◆ mAtmosphereTypes

AtmosphereTypes SOSM_Manager::mAtmosphereTypes
protected

◆ mCacheDirectory

std::string SOSM_Manager::mCacheDirectory
protected

◆ mDebugLevel

int SOSM_Manager::mDebugLevel
protected

◆ mDefaultAtmosphereType

std::string SOSM_Manager::mDefaultAtmosphereType
protected

◆ mIgnoreCacheFiles

bool SOSM_Manager::mIgnoreCacheFiles
protected

◆ mSensorTypes

SensorTypes SOSM_Manager::mSensorTypes
protected

◆ mShowIRIPP_Data

bool SOSM_Manager::mShowIRIPP_Data
protected

◆ mShowStatus

bool SOSM_Manager::mShowStatus
protected

◆ mTargetTypes

TargetTypes SOSM_Manager::mTargetTypes
protected

◆ mTestCommandsPtr

SOSM_TestCommands* SOSM_Manager::mTestCommandsPtr
protected

◆ mUseFastDetectionMode

bool SOSM_Manager::mUseFastDetectionMode
protected

◆ mUtAtmosphere

UtAtmosphere SOSM_Manager::mUtAtmosphere
protected

◆ mWriteCacheFiles

bool SOSM_Manager::mWriteCacheFiles
protected

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved