WSF
WsfDeferredInput Class Reference

#include <WsfDeferredInput.hpp>

Classes

struct  Loader

Public Types

using UniqueId = std::pair<std::string, std::string>
using ProcessInputFunction = std::function<bool(UtInput&)>

Public Member Functions

 WsfDeferredInput ()
bool IsDelayLoading ()
void DelayLoad (const std::string &aKind, const std::string &aName, const UtInput::StoredLocation &aPosition, const ProcessInputFunction &aInputFunction)
void Requires (const std::string &aKind, const std::string &aName)
void MaybeRequires (const std::string &aKind, const std::string &aName)
void Resolve (UtInput &aInput)
void Clear ()
void ResetDelays ()

Protected Types

using LoaderMap = std::multimap<UniqueId, Loader>

Protected Member Functions

bool IsDelayLoadingP ()
void DelayLoadP (const std::string &aKind, const std::string &aName, const UtInput::StoredLocation &aPosition, const ProcessInputFunction &aInputFunction)
void RequiresP (const std::string &aKind, const std::string &aName)
void ResolveP (UtInput &aInput)
void ResetDelaysP ()
void ClearP ()

Protected Attributes

bool mIsDelayLoading
UtInput * mRootInputPtr
LoaderMap mDelayLoaders
std::set< UniqueIdmCurrentlyLoading
std::vector< UtInput * > mInputStack
std::set< UniqueIdmCompleted
std::vector< UniqueIdmDelayLoadOrder

Detailed Description

Contains input utilities for WSF.

WSF does 'delayed' loading for many types of objects. When delay loading, an object's kind and name are scanned, remembered, and bypassed until a later time.

For instance: sensor MySensor MySensorTYPE ... end_sensor Here, 'sensor MySensor' is saved using WsfDeferredInput::DelayLoad(), and then the entire block is skipped until all initial input processing has been completed. Finally, WsfDeferredInput::Resolve() finishes reading the delay load blocks. If an object depends on another object at input-time, a call to WsfDeferredInput::Requires() ensures that dependency is met before input processing continues.

Any object which has input-time dependencies should use the delay load feature.

Member Typedef Documentation

◆ LoaderMap

using WsfDeferredInput::LoaderMap = std::multimap<UniqueId, Loader>
protected

◆ ProcessInputFunction

using WsfDeferredInput::ProcessInputFunction = std::function<bool(UtInput&)>

◆ UniqueId

using WsfDeferredInput::UniqueId = std::pair<std::string, std::string>

Constructor & Destructor Documentation

◆ WsfDeferredInput()

WsfDeferredInput::WsfDeferredInput ( )

Member Function Documentation

◆ Clear()

void WsfDeferredInput::Clear ( )
inline

References ClearP().

◆ ClearP()

void WsfDeferredInput::ClearP ( )
protected

◆ DelayLoad()

void WsfDeferredInput::DelayLoad ( const std::string & aKind,
const std::string & aName,
const UtInput::StoredLocation & aPosition,
const ProcessInputFunction & aInputFunction )
inline

◆ DelayLoadP()

void WsfDeferredInput::DelayLoadP ( const std::string & aKind,
const std::string & aName,
const UtInput::StoredLocation & aPosition,
const ProcessInputFunction & aInputFunction )
protected

◆ IsDelayLoading()

bool WsfDeferredInput::IsDelayLoading ( )
inline

Returns true if the delay load phase is active. In this phase, types that were skipped during the first pass are finally processed.

References IsDelayLoadingP().

◆ IsDelayLoadingP()

bool WsfDeferredInput::IsDelayLoadingP ( )
protected

References mIsDelayLoading.

Referenced by IsDelayLoading().

◆ MaybeRequires()

void WsfDeferredInput::MaybeRequires ( const std::string & aKind,
const std::string & aName )

◆ Requires()

◆ RequiresP()

void WsfDeferredInput::RequiresP ( const std::string & aKind,
const std::string & aName )
protected

◆ ResetDelays()

void WsfDeferredInput::ResetDelays ( )
inline

References ResetDelaysP().

◆ ResetDelaysP()

void WsfDeferredInput::ResetDelaysP ( )
protected

References mCompleted, mDelayLoaders, and mDelayLoadOrder.

Referenced by ResetDelays().

◆ Resolve()

void WsfDeferredInput::Resolve ( UtInput & aInput)
inline

References ResolveP().

◆ ResolveP()

void WsfDeferredInput::ResolveP ( UtInput & aInput)
protected

Member Data Documentation

◆ mCompleted

std::set<UniqueId> WsfDeferredInput::mCompleted
protected

◆ mCurrentlyLoading

std::set<UniqueId> WsfDeferredInput::mCurrentlyLoading
protected

Referenced by ClearP(), RequiresP(), and WsfDeferredInput().

◆ mDelayLoaders

LoaderMap WsfDeferredInput::mDelayLoaders
protected

◆ mDelayLoadOrder

std::vector<UniqueId> WsfDeferredInput::mDelayLoadOrder
protected

◆ mInputStack

std::vector<UtInput*> WsfDeferredInput::mInputStack
protected

Referenced by ClearP(), RequiresP(), and WsfDeferredInput().

◆ mIsDelayLoading

bool WsfDeferredInput::mIsDelayLoading
protected

◆ mRootInputPtr

UtInput* WsfDeferredInput::mRootInputPtr
protected

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