|
WSF
|
#include <WsfCyberConstraint.hpp>


Public Member Functions | |
| Constraint () | |
| Public Member Functions inherited from WsfComponentT< WsfPlatform > | |
| WsfComponentT () | |
| WsfComponentT (const WsfComponentT &) noexcept | |
| WsfComponentT & | operator= (const WsfComponentT &) noexcept |
| ~WsfComponentT () override=default | |
| virtual void | ComponentParentChanged (ParentType *aParentPtr) |
| ParentType * | GetComponentParent () const |
| void | SetComponentParent (ParentType *aParentPtr) |
| Public Member Functions inherited from WsfComponent | |
| virtual | ~WsfComponent ()=default |
| virtual int | GetComponentInitializationOrder () const |
| template<typename T> | |
| bool | QueryInterfaceT (T *&aRolePtr) |
| bool | ComponentHasRole (int aRole) |
| Returns true if the component has the specified role. | |
| virtual bool | PreInitialize (double aSimTime) |
| virtual bool | Initialize (double aSimTime) |
| virtual bool | Initialize2 (double aSimTime) |
| virtual void | PreInput () |
| Public Member Functions inherited from WsfObject | |
| WsfObject () | |
| This is the constructor for the WsfObject class. | |
| ~WsfObject () override | |
| This is the destructor for the WsfObject class. | |
| const char * | GetScriptClassName () const override |
| const std::string & | GetType () const |
| WsfStringId | GetTypeId () const |
| Get the string ID of the 'type' of the object. | |
| void | SetType (WsfStringId aType) |
| const std::string & | GetBaseType () const |
| WsfStringId | GetBaseTypeId () const |
| const TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (const WsfObject &aRhs) |
| Assignment operator. | |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| For XIO (de)serialization. | |
| const std::string & | GetName () const |
| WsfStringId | GetNameId () const |
| void | SetName (WsfStringId aName) |
Cyber resource methods | |
| double | GetCurrentResources () const |
| double | GetTotalResources () const |
| bool | RestoreResources (double aQuantity) |
| bool | RemoveResources (double aQuantity) |
Component infrastructure methods. | |
| WsfStringId | GetComponentName () const override |
| const int * | GetComponentRoles () const override |
| WsfComponent * | CloneComponent () const override |
| void * | QueryInterface (int aRole) override |
| static Constraint * | Find (const WsfPlatform &aPlatform) |
| static Constraint * | FindOrCreate (WsfPlatform &aPlatform) |
Framework methods. | |
| bool | ProcessInput (UtInput &aInput) override |
| Constraint * | Clone () const override |
External C2 monitoring methods. | |
| size_t | GetConcurrentAttacks (const std::string &aAttackType) const |
| void | AddConcurrentAttack (const std::string &aAttackType, size_t aEngagementID) |
| void | RemoveConcurrentAttack (const std::string &aAttackType, size_t aEngagementID) |
| void | AddAttackTime (const std::string &aAttackType, double aSimTime) |
| size_t | GetAttackCountAfterTime (const std::string &aAttackType, double aSimTime) const |
Additional Inherited Members | |
| Public Types inherited from WsfComponentT< WsfPlatform > | |
| typedef WsfPlatform | ParentType |
| This is needed to support the WsfComponentList template. | |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| The list of types returned by GetTypeList. | |
| WsfObject (const WsfObject &aSrc) | |
| Copy constructor (for Clone()). | |
A class that models the concept of a platform having unique factors that can restrict or degrade outgoing cyber attacks. The class also has script hooks to allow for external script level C2 logic. For example a platform may only conduct a particular attack x times/hour or have x concurrent attacks. If a platform does not have sufficient resources available for an attack that requires resources then the attack will not be initiated.
| wsf::cyber::Constraint::Constraint | ( | ) |
References WsfObject::SetName().
Referenced by Clone(), CloneComponent(), Find(), and FindOrCreate().
| void wsf::cyber::Constraint::AddAttackTime | ( | const std::string & | aAttackType, |
| double | aSimTime ) |
| void wsf::cyber::Constraint::AddConcurrentAttack | ( | const std::string & | aAttackType, |
| size_t | aEngagementID ) |
|
inlineoverridevirtual |
Return a copy of this object. Must be implemented by all derived types. If cloning is impossible, a WsfUncloneableException should be thrown.
Implements WsfObject.
References Constraint().
|
overridevirtual |
Clones a component. May return null if component does not support clone.
Implements WsfComponent.
References Constraint().
|
static |
References Constraint(), and WsfComponentListT< COMPONENT_TYPE >::FindComponentByRole().
Referenced by wsf::cyber::EngagementManager::CyberAttackInitialize(), FindOrCreate(), wsf::cyber::Engagement::MakeConstraintReservations(), wsf::cyber::Engagement::MeetsAttackerConstraints(), and wsf::cyber::Engagement::ReleaseAttackerConstraints().
|
static |
References Constraint(), Find(), and WsfPlatform::GetComponents().
| size_t wsf::cyber::Constraint::GetAttackCountAfterTime | ( | const std::string & | aAttackType, |
| double | aSimTime ) const |
References pos.
|
inlineoverridevirtual |
Returns the component's name. Each component in a component list has a unique name. Names are usually defined by the user, but they may also be generated by code and prefixed with a '#' to guarantee no collisions with user-defined names.
Implements WsfComponent.
References WsfObject::GetNameId().
|
overridevirtual |
Returns a zero-terminated array of component roles. Note that the array should be in decreasing order of specificity and should generally the inheritance hierarchy. The first entry should be the components 'primary' role. For example a sensor would do the following:
Implements WsfComponent.
References cWSF_COMPONENT_CYBER_CONSTRAINT, and cWSF_COMPONENT_NULL.
| size_t wsf::cyber::Constraint::GetConcurrentAttacks | ( | const std::string & | aAttackType | ) | const |
|
inline |
|
inline |
|
overridevirtual |
Evaluate the current input command and determine if it is one processed by the component. The component should get the current command from the input stream and determine if it is one that it recognizes. If it does not recognize the command then it should leave the command in the input stream and return false. If it does recognize the command then it should process the command and return true. If invalid arguments are encountered then it should throw an exception.
| aInput | The input stream. |
| UtInput::ExceptionBase | if an invalid input was encountered. |
Reimplemented from WsfComponent.
|
overridevirtual |
Requests a component's role interface. A component can support one or more roles.
| aRole | The role whose interface is to be returned. |
Implements WsfComponent.
References cWSF_COMPONENT_CYBER_CONSTRAINT.
| void wsf::cyber::Constraint::RemoveConcurrentAttack | ( | const std::string & | aAttackType, |
| size_t | aEngagementID ) |
| bool wsf::cyber::Constraint::RemoveResources | ( | double | aQuantity | ) |
| bool wsf::cyber::Constraint::RestoreResources | ( | double | aQuantity | ) |