WsfCommMessage

WsfCommMessage inherits Object

Description

This script class provides access to the WsfCommMessage object, which is a container for a standard WsfMessage. This object is typically used internally to the comm framework in AFSIM, but is occasionally exposed to provide the additional data used by the comm framework in the script context.

Methods

Array<WsfAddress> GetTraceRoute()

Provides the traceroute of the current address. Every comm interface a message is transmitted from to reach its final destination adds its address to the traceroute within the comm framework. This provides that history of which interfaces this message has passed through up until the time of this call.

Note that the traceroute does not contain the address for an interface that has not yet transmitted a message, such that if the traceroute is being inspected on the originator interface, this traceroute will be empty.

int GetTTL()

Provides the number of hops (time-to-live) for this message, as set by the message’s originating router interface. Any potential path to a destination that exceeds the TTL value will not reach its destination using that path, and will be dropped.

WsfMessage GetSourceMessage()

Provides the WsfMessage object being held by this container.

Auxiliary Data Methods

Auxiliary Data is a collection of optional named user data attributes that can be stored with the object. The framework will maintain the attributes but in no other way attempts to use the data contained within. The definition and use of any attribute is defined purely by the user.

bool AuxDataBool(string aName)
int AuxDataInt(string aName)
double AuxDataDouble(string aName)
string AuxDataString(string aName)
Object AuxDataObject(string aName)

Retrieve the value of the auxiliary data attribute with the indicated name. If the attribute does not exist then a default value will be returned (false for bool, 0 for int and 0.0 for double).

bool AuxDataExists(string aName)
bool CheckAuxData(string aName)

Returns true if an auxiliary data member exists with the specified name.

bool HasAuxData()

Returns true if the object has auxiliary data.

bool DeleteAuxData(string aName)

Delete the auxiliary data attribute with the indicated name. Returns true if the attribute exists and was deleted, or false if the attribute did not exist.

void SetAuxData(string aName, bool aValue)
void SetAuxData(string aName, int aValue)
void SetAuxData(string aName, double aValue)
void SetAuxData(string aName, string aValue)
void SetAuxData(string aName, Object aValue)

Set the value of the auxiliary data attribute with the indicated name. The last form of SetAuxData() can store any script object type.

Map<string, string> GetAllAuxDataTypes()

Return the names and types of all auxiliary data attributes in the form of a Map<string,string>. Map keys are valid names of auxiliary data attributes. Map values are type names corresponding to valid auxiliary data attribute names.