WSF
WsfComponentRoles.hpp File Reference
#include <type_traits>
Include dependency graph for WsfComponentRoles.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  WsfComponentRole< T >
struct  WsfComponentRole< T >::always_false< U >
struct  cCOMPONENT_ROLE< T >

Macros

#define WSF_DECLARE_COMPONENT_ROLE_TYPE(TYPE, ROLE)

Enumerations

enum  {
  cWSF_COMPONENT_NULL = 0 , cWSF_COMPONENT_PLATFORM = 1 , cWSF_COMPONENT_PLATFORM_PART = 2 , cWSF_COMPONENT_ARTICULATED_PART = 3 ,
  cWSF_COMPONENT_MOVER = 4 , cWSF_COMPONENT_FUEL = 5 , cWSF_COMPONENT_COMM = 6 , cWSF_COMPONENT_COMM_ROUTER = 7 ,
  cWSF_COMPONENT_PROCESSOR = 8 , cWSF_COMPONENT_SENSOR = 9 , cWSF_COMPONENT_VISUAL = 10 , cWSF_COMPONENT_TRACK_MANAGER = 11 ,
  cWSF_COMPONENT_NAVIGATION_ERRORS = 12 , cWSF_COMPONENT_COMMAND_CHAIN = 13 , cWSF_COMPONENT_ZONE = 14 , cWSF_COMPONENT_GEOPOINT = 15 ,
  cWSF_COMPONENT_CALLBACK = 16 , cWSF_COMPONENT_INTERSECT_MESH = 17 , cWSF_COMPONENT_THERMAL_SYSTEM = 18 , cWSF_COMPONENT_COMM_HW = 61 ,
  cWSF_COMPONENT_COMM_XIO = 62 , cWSF_COMPONENT_COMM_PROTOCOL = 63 , cWSF_COMPONENT_COMM_PROTOCOL_IGMP = 64 , cWSF_COMPONENT_COMM_ROUTER_PROTOCOL = 65 ,
  cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_LEGACY = 66 , cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_RIPv2 = 67 , cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_OSPF = 68 , cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_MULTICAST = 69 ,
  cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_AD_HOC = 70 , cWSF_COMPONENT_COMM_MEDIUM_CONTAINER_COMM = 71 , cWSF_COMPONENT_COMM_MEDIUM_CONTAINER_ROUTER = 72 , cWSF_COMPONENT_EM_XMTR = 98 ,
  cWSF_COMPONENT_EM_RCVR = 99 , cWSF_COMPONENT_EM_INTERACTION = 100 , cWSF_COMPONENT_PROCESSOR_COMPONENT = 101 , cWSF_COMPONENT_TASK_MANAGER = 102 ,
  cWSF_COMPONENT_TASK_MANAGER_COMPONENT = 103 , cWSF_COMPONENT_SENSOR_COMPONENT = 104 , cWSF_COMPONENT_SENSOR_EXCLUSION = 105 , cWSF_COMPONENT_SENSOR_MOON_LOS = 106 ,
  cWSF_COMPONENT_SOLAR_ILLUMINATION = 107 , cWSF_COMPONENT_SOLAR_ELEVATION_AT_TARGET = 108
}
enum  {
  cWSF_INITIALIZE_ORDER_COMMAND_CHAIN = -1000000000 , cWSF_INITIALIZE_ORDER_TRACK_MANAGER = -900000000 , cWSF_INITIALIZE_ORDER_MOVER = -800000000 , cWSF_INITIALIZE_ORDER_FUEL = -790000000 ,
  cWSF_INITIALIZE_ORDER_NAVIGATION_ERRORS = -780000000 , cWSF_INITIALIZE_ORDER_ROUTER = -740000000 , cWSF_INITIALIZE_ORDER_COMM = -700000000 , cWSF_INITIALIZE_ORDER_PROCESSOR = -600000000 ,
  cWSF_INITIALIZE_ORDER_SENSOR = -500000000 , cWSF_INITIALIZE_ORDER_VISUAL_PART = -400000000 , cWSF_INITIALIZE_ORDER_RESERVED = -300000000 , cWSF_INITIALIZE_ORDER_ZONE = -100000000
}

Macro Definition Documentation

◆ WSF_DECLARE_COMPONENT_ROLE_TYPE

#define WSF_DECLARE_COMPONENT_ROLE_TYPE ( TYPE,
ROLE )
Value:
template<> \
struct WsfComponentRole<TYPE> : std::integral_constant<int, ROLE> \
{ \
static_assert(std::is_base_of<WsfComponent, TYPE>::value, \
"Cannot register component role for type that does not derive from WsfComponent"); \
static_assert(value > 0, "Component role must be > 0"); \
};
Definition WsfComponentRoles.hpp:22

Helper macro to declare a component role for a type by specializing WsfComponentRole template. If TYPE is in a namespace, the macro has to be outside the namespace: namespace wsf { namespace comm { class Comm { ... }; ... } } WSF_DECLARE_COMPONENT_ROLE_TYPE(wsf::comm::Comm, cWSF_COMPONENT_COMM)

Referenced by WSF_DECLARE_COMPONENT_ROLE_TYPE(), and WSF_DECLARE_COMPONENT_ROLE_TYPE().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

The standard component roles.

Every component type has one or more 'roles', each of which is assigned a number. These numbers are defined by committee (much like DIS enumerations), with several guidelines as follows:

  • Numbers 0-199 are reserved for components that are part of the AFSIM core (directory 'wsf')
  • Numbers 200-999 are reserved for components that are part of AFSIM but are located in other directories. These numbers are not published here for security reasons, but are agreed to and defined in their respective directories.
  • Numbers 1000 and above are reserved for allocation to sites.

A component may have multiple roles that it returns in the method WsfComponent::GetComponentRoles. The first entry in the list is its 'primary' role while others are used represent other roles in the inheritance hierarchy of the component.

For instance, WsfSensor returns the following list:

@ cWSF_COMPONENT_SENSOR
A 'sensor' component (WsfSensor).
Definition WsfComponentRoles.hpp:105
@ cWSF_COMPONENT_PLATFORM_PART
The component derives from WsfPlatformPart.
Definition WsfComponentRoles.hpp:98
@ cWSF_COMPONENT_NULL
A special entry to indicate the end of the list of roles assumed by a component.
Definition WsfComponentRoles.hpp:92
@ cWSF_COMPONENT_ARTICULATED_PART
The component derives from WsfArticulatedPart.
Definition WsfComponentRoles.hpp:99

The definitions of multiple roles allows one to invoke WsfComponent::QueryInterface to retrieve a pointer to a specific interface.

Enumerator
cWSF_COMPONENT_NULL 

A special entry to indicate the end of the list of roles assumed by a component.

cWSF_COMPONENT_PLATFORM 

The component is or derives from WsfPlatform.

cWSF_COMPONENT_PLATFORM_PART 

The component derives from WsfPlatformPart.

cWSF_COMPONENT_ARTICULATED_PART 

The component derives from WsfArticulatedPart.

cWSF_COMPONENT_MOVER 

A 'mover' component (WsfMover).

cWSF_COMPONENT_FUEL 

A 'fuel' component (WsfFuel).

cWSF_COMPONENT_COMM 

A 'comm' component (WsfComm).

cWSF_COMPONENT_COMM_ROUTER 

A 'router' component (WsfCommRouter).

cWSF_COMPONENT_PROCESSOR 

A 'processor' component (WsfProcessor).

cWSF_COMPONENT_SENSOR 

A 'sensor' component (WsfSensor).

cWSF_COMPONENT_VISUAL 

A 'visual_part' component (WsfVisualPart).

cWSF_COMPONENT_TRACK_MANAGER 

A 'track manager' component (WsfTrackManager).

cWSF_COMPONENT_NAVIGATION_ERRORS 

A 'navigation_error' component (WsfNavigationErrors).

cWSF_COMPONENT_COMMAND_CHAIN 

A 'command_chain' component (WsfCommandChain).

cWSF_COMPONENT_ZONE 

A 'zone' component (WsfZone).

cWSF_COMPONENT_GEOPOINT 

A 'geopoint' component (WsfGeoPoint).

cWSF_COMPONENT_CALLBACK 

A 'callback' component (WsfCallback).

cWSF_COMPONENT_INTERSECT_MESH 

A 'intersect_mesh" component (WsfIntersectMesh).

cWSF_COMPONENT_THERMAL_SYSTEM 

A 'thermal system' component.

cWSF_COMPONENT_COMM_HW 
cWSF_COMPONENT_COMM_XIO 
cWSF_COMPONENT_COMM_PROTOCOL 
cWSF_COMPONENT_COMM_PROTOCOL_IGMP 
cWSF_COMPONENT_COMM_ROUTER_PROTOCOL 
cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_LEGACY 
cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_RIPv2 
cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_OSPF 
cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_MULTICAST 
cWSF_COMPONENT_COMM_ROUTER_PROTOCOL_AD_HOC 
cWSF_COMPONENT_COMM_MEDIUM_CONTAINER_COMM 
cWSF_COMPONENT_COMM_MEDIUM_CONTAINER_ROUTER 
cWSF_COMPONENT_EM_XMTR 

WsfEM_Xmtr.

cWSF_COMPONENT_EM_RCVR 

WSFEM_Rcvr.

cWSF_COMPONENT_EM_INTERACTION 

An extension to WsfEM_Interaction.

cWSF_COMPONENT_PROCESSOR_COMPONENT 

An extension to WsfProcessor.

cWSF_COMPONENT_TASK_MANAGER 

An extension to WsfTaskManager.

cWSF_COMPONENT_TASK_MANAGER_COMPONENT 

A Component on a WsfTaskManager.

cWSF_COMPONENT_SENSOR_COMPONENT 

A Component on a WsfSensor.

cWSF_COMPONENT_SENSOR_EXCLUSION 

A Solar or lunar exclusion angle component.

cWSF_COMPONENT_SENSOR_MOON_LOS 

A Component enabling Moon LOS checks.

cWSF_COMPONENT_SOLAR_ILLUMINATION 

Solar Illumination command sensor component.

cWSF_COMPONENT_SOLAR_ELEVATION_AT_TARGET 

A solar elevation from target sensor component.

◆ anonymous enum

anonymous enum

These are some reference component initialization orders. Gaps are left so new components can reference these values and insert themselves where needed. Note that unless an order is assigned, all components with no order will be assigned a value of 0 and will be initialized in the order in the input file.

These are signed ints so they have values of about [-2 billion, +2 billion].

Enumerator
cWSF_INITIALIZE_ORDER_COMMAND_CHAIN 

Command chains aren't dependent on anything, but something may be dependent on them.

cWSF_INITIALIZE_ORDER_TRACK_MANAGER 

The track manager must be initialized prior to the mover.

cWSF_INITIALIZE_ORDER_MOVER 

The mover must be initialized prior to just about everything else because it defines the initial location.

cWSF_INITIALIZE_ORDER_FUEL 
cWSF_INITIALIZE_ORDER_NAVIGATION_ERRORS 
cWSF_INITIALIZE_ORDER_ROUTER 
cWSF_INITIALIZE_ORDER_COMM 
cWSF_INITIALIZE_ORDER_PROCESSOR 
cWSF_INITIALIZE_ORDER_SENSOR 
cWSF_INITIALIZE_ORDER_VISUAL_PART 
cWSF_INITIALIZE_ORDER_RESERVED 
cWSF_INITIALIZE_ORDER_ZONE 

Zones generally aren't dependent on anything except position, but something may be dependent on them.

'zones' components

Copyrights Multiple, All Rights Reserved