org.npsnet.xrti.proxies
Class HLAbasicRepresentationProxy

java.lang.Object
  extended byorg.npsnet.xrti.utilities.ObjectInstanceProxy
      extended byorg.npsnet.xrti.proxies.HLAobjectRootProxy
          extended byorg.npsnet.xrti.proxies.HLAreflectionProxy
              extended byorg.npsnet.xrti.proxies.HLAdataTypeProxy
                  extended byorg.npsnet.xrti.proxies.HLAbasicRepresentationProxy
All Implemented Interfaces:
HLAbasicRepresentation, HLAdataType, HLAobjectRoot, HLAreflection

public class HLAbasicRepresentationProxy
extends HLAdataTypeProxy
implements HLAbasicRepresentation

Represents an HLA basic representation.

Author:
org.npsnet.xrti.utilities.ProxyCompiler

Field Summary
private  java.lang.String encoding
          The encoding of the basic representation.
private  AttributeHandle encodingHandle
          The handle of the encoding attribute.
private  boolean encodingIsDirty
          Whether or not the encoding attribute has changed.
private  boolean encodingIsValid
          Whether or not the encoding attribute has been set.
private  HLAendianType endian
          The byte ordering of the basic representation.
private  AttributeHandle endianHandle
          The handle of the endian attribute.
private  boolean endianIsDirty
          Whether or not the endian attribute has changed.
private  boolean endianIsValid
          Whether or not the endian attribute has been set.
private  java.util.Vector HLAbasicRepresentationListeners
          Listeners for attributes associated with the HLAbasicRepresentation class.
private  java.lang.String interpretation
          The interpretation of the basic representation.
private  AttributeHandle interpretationHandle
          The handle of the interpretation attribute.
private  boolean interpretationIsDirty
          Whether or not the interpretation attribute has changed.
private  boolean interpretationIsValid
          Whether or not the interpretation attribute has been set.
private  int size
          The size of the basic representation.
private  AttributeHandle sizeHandle
          The handle of the size attribute.
private  boolean sizeIsDirty
          Whether or not the size attribute has changed.
private  boolean sizeIsValid
          Whether or not the size attribute has been set.
 
Fields inherited from class org.npsnet.xrti.proxies.HLAdataTypeProxy
 
Fields inherited from class org.npsnet.xrti.proxies.HLAreflectionProxy
 
Fields inherited from class org.npsnet.xrti.proxies.HLAobjectRootProxy
 
Fields inherited from class org.npsnet.xrti.utilities.ObjectInstanceProxy
autoFlushDisabled, classHandle, deleted, instanceHandle, rtiAmbassador
 
Constructor Summary
protected HLAbasicRepresentationProxy(RTIambassador pRTIAmbassador, ObjectClassHandle pClassHandle)
          Constructor for object instance proxies created to represent new locally owned objects.
protected HLAbasicRepresentationProxy(RTIambassador pRTIAmbassador, ObjectClassHandle pClassHandle, java.lang.String pName)
          Constructor for object instance proxies created to represent new locally owned objects.
protected HLAbasicRepresentationProxy(RTIambassador pRTIAmbassador, ObjectInstanceHandle pInstanceHandle, ObjectClassHandle pClassHandle, java.lang.String pName)
          Constructor for object instance proxies created in response to discovered objects.
 
Method Summary
 void addHLAbasicRepresentationListener(HLAbasicRepresentationListener l)
          Adds a listener for attributes associated with the HLAbasicRepresentation class.
protected  void getAttributeValuesToFlush(AttributeHandleValueMap ahvm, boolean superFlush)
          Places the attribute values to flush into the specified map.
 java.lang.String getEncoding()
          Returns the value of the encoding attribute.
 HLAendianType getEndian()
          Returns the value of the endian attribute.
 java.lang.String getInterpretation()
          Returns the value of the interpretation attribute.
 int getSize()
          Returns the value of the size attribute.
private  void initializeAttributes()
          Initializes the attributes and their handles.
 void provideAttributeValueUpdate(AttributeHandleSet theAttributes, byte[] userSuppliedTag)
          Notifies the proxy that it should provide an update regarding a set of object attributes.
 void reflectAttributeValues(AttributeHandleValueMap theAttributes, byte[] userSuppliedTag, OrderType sentOrdering, TransportationType theTransport)
          Notifies the proxy of changes to the state of an object instance.
 void removeHLAbasicRepresentationListener(HLAbasicRepresentationListener l)
          Removes a listener for attributes associated with the HLAbasicRepresentation class.
 void setEncoding(java.lang.String pEncoding, byte[] userSuppliedTag)
          Sets the value of the encoding attribute.
 void setEndian(HLAendianType pEndian, byte[] userSuppliedTag)
          Sets the value of the endian attribute.
 void setInterpretation(java.lang.String pInterpretation, byte[] userSuppliedTag)
          Sets the value of the interpretation attribute.
 void setSize(int pSize, byte[] userSuppliedTag)
          Sets the value of the size attribute.
 
Methods inherited from class org.npsnet.xrti.proxies.HLAdataTypeProxy
addHLAdataTypeListener, removeHLAdataTypeListener
 
Methods inherited from class org.npsnet.xrti.proxies.HLAreflectionProxy
addHLAreflectionListener, getName, removeHLAreflectionListener, setName
 
Methods inherited from class org.npsnet.xrti.proxies.HLAobjectRootProxy
addHLAobjectRootListener, removeHLAobjectRootListener
 
Methods inherited from class org.npsnet.xrti.utilities.ObjectInstanceProxy
delete, equals, flushAttributeValues, flushAttributeValues, getAutoFlushDisabled, getClassHandle, getInstanceHandle, hashCode, isDeleted, reflectAttributeValues, reflectAttributeValues, reflectAttributeValues, reflectAttributeValues, reflectAttributeValues, setAutoFlushDisabled, setDeleted, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.npsnet.xrti.proxies.HLAdataType
addHLAdataTypeListener, removeHLAdataTypeListener
 
Methods inherited from interface org.npsnet.xrti.proxies.HLAreflection
addHLAreflectionListener, getName, removeHLAreflectionListener, setName
 
Methods inherited from interface org.npsnet.xrti.proxies.HLAobjectRoot
addHLAobjectRootListener, removeHLAobjectRootListener
 

Field Detail

HLAbasicRepresentationListeners

private java.util.Vector HLAbasicRepresentationListeners
Listeners for attributes associated with the HLAbasicRepresentation class.


sizeHandle

private AttributeHandle sizeHandle
The handle of the size attribute.


sizeIsValid

private boolean sizeIsValid
Whether or not the size attribute has been set.


sizeIsDirty

private boolean sizeIsDirty
Whether or not the size attribute has changed.


size

private int size
The size of the basic representation.


endianHandle

private AttributeHandle endianHandle
The handle of the endian attribute.


endianIsValid

private boolean endianIsValid
Whether or not the endian attribute has been set.


endianIsDirty

private boolean endianIsDirty
Whether or not the endian attribute has changed.


endian

private HLAendianType endian
The byte ordering of the basic representation.


interpretationHandle

private AttributeHandle interpretationHandle
The handle of the interpretation attribute.


interpretationIsValid

private boolean interpretationIsValid
Whether or not the interpretation attribute has been set.


interpretationIsDirty

private boolean interpretationIsDirty
Whether or not the interpretation attribute has changed.


interpretation

private java.lang.String interpretation
The interpretation of the basic representation.


encodingHandle

private AttributeHandle encodingHandle
The handle of the encoding attribute.


encodingIsValid

private boolean encodingIsValid
Whether or not the encoding attribute has been set.


encodingIsDirty

private boolean encodingIsDirty
Whether or not the encoding attribute has changed.


encoding

private java.lang.String encoding
The encoding of the basic representation.

Constructor Detail

HLAbasicRepresentationProxy

protected HLAbasicRepresentationProxy(RTIambassador pRTIAmbassador,
                                      ObjectInstanceHandle pInstanceHandle,
                                      ObjectClassHandle pClassHandle,
                                      java.lang.String pName)
                               throws RTIinternalError
Constructor for object instance proxies created in response to discovered objects.

Parameters:
pRTIAmbassador - the run-time infrastructure ambassador
pInstanceHandle - the object instance handle
pClassHandle - the object class handle
pName - the object name
Throws:
RTIinternalError - if an internal error occurred in the run-time infrastructure

HLAbasicRepresentationProxy

protected HLAbasicRepresentationProxy(RTIambassador pRTIAmbassador,
                                      ObjectClassHandle pClassHandle)
                               throws ObjectClassNotDefined,
                                      ObjectClassNotPublished,
                                      FederateNotExecutionMember,
                                      SaveInProgress,
                                      RestoreInProgress,
                                      RTIinternalError
Constructor for object instance proxies created to represent new locally owned objects. Automatically notifies the run-time infrastructure.

Parameters:
pRTIAmbassador - the run-time infrastructure ambassador
pClassHandle - the object class handle
Throws:
ObjectClassNotDefined - if the specified object class is not defined
ObjectClassNotPublished - if the specified object class is not published
FederateNotExecutionMember - if the federate is not a member of an execution
SaveInProgress - if a save operation is in progress
RestoreInProgress - if a restore operation is in progress
RTIinternalError - if an internal error occurred in the run-time infrastructure

HLAbasicRepresentationProxy

protected HLAbasicRepresentationProxy(RTIambassador pRTIAmbassador,
                                      ObjectClassHandle pClassHandle,
                                      java.lang.String pName)
                               throws ObjectClassNotDefined,
                                      ObjectClassNotPublished,
                                      IllegalName,
                                      ObjectInstanceNameInUse,
                                      FederateNotExecutionMember,
                                      SaveInProgress,
                                      RestoreInProgress,
                                      RTIinternalError
Constructor for object instance proxies created to represent new locally owned objects. Automatically notifies the run-time infrastructure.

Parameters:
pRTIAmbassador - the run-time infrastructure ambassador
pClassHandle - the object class handle
pName - the object name
Throws:
ObjectClassNotDefined - if the specified object class is not defined
ObjectClassNotPublished - if the specified object class is not published
IllegalName - if the instance name has is illegal
ObjectInstanceNameInUse - if the instance name is already in use
FederateNotExecutionMember - if the federate is not a member of an execution
SaveInProgress - if a save operation is in progress
RestoreInProgress - if a restore operation is in progress
RTIinternalError - if an internal error occurred in the run-time infrastructure
Method Detail

initializeAttributes

private void initializeAttributes()
                           throws InvalidObjectClassHandle,
                                  NameNotFound,
                                  ObjectClassNotDefined,
                                  AttributeNotDefined,
                                  FederateNotExecutionMember,
                                  SaveInProgress,
                                  RestoreInProgress,
                                  RTIinternalError
Initializes the attributes and their handles.

Throws:
InvalidObjectClassHandle - if an object class handle is invalid
NameNotFound - if a name is not found
ObjectClassNotDefined - if an object class is not defined
AttributeNotDefined - if an attribute is not defined
FederateNotExecutionMember - if the federate is not an execution member
SaveInProgress - if a save operation is in progress
RestoreInProgress - if a restore operation is in progress
RTIinternalError - if an internal error occurred in the run-time infrastructure

reflectAttributeValues

public void reflectAttributeValues(AttributeHandleValueMap theAttributes,
                                   byte[] userSuppliedTag,
                                   OrderType sentOrdering,
                                   TransportationType theTransport)
                            throws AttributeNotRecognized,
                                   AttributeNotSubscribed,
                                   FederateInternalError
Notifies the proxy of changes to the state of an object instance.

Overrides:
reflectAttributeValues in class HLAdataTypeProxy
Parameters:
theAttributes - the map between attribute handles and the new values of the identified attributes
userSuppliedTag - a user-supplied tag associated with the state change
sentOrdering - the type of ordering with which the update was sent
theTransport - the type of transport associated with the update
Throws:
AttributeNotRecognized - if the attribute was not recognized
AttributeNotSubscribed - if the federate had not subscribed to the attribute
FederateInternalError - if an error occurs in the federate

provideAttributeValueUpdate

public void provideAttributeValueUpdate(AttributeHandleSet theAttributes,
                                        byte[] userSuppliedTag)
                                 throws AttributeNotRecognized,
                                        AttributeNotOwned,
                                        FederateInternalError
Notifies the proxy that it should provide an update regarding a set of object attributes.

Overrides:
provideAttributeValueUpdate in class HLAdataTypeProxy
Parameters:
theAttributes - the set of attribute handles identifying the attributes that should be sent
userSuppliedTag - the user-supplied tag associated with the request
Throws:
AttributeNotRecognized - if an identified attribute was not recognized
AttributeNotOwned - if the federate did not own a specified attribute
FederateInternalError - if an error occurs in the federate

getAttributeValuesToFlush

protected void getAttributeValuesToFlush(AttributeHandleValueMap ahvm,
                                         boolean superFlush)
                                  throws RTIinternalError
Places the attribute values to flush into the specified map.

Overrides:
getAttributeValuesToFlush in class HLAdataTypeProxy
Parameters:
ahvm - the attribute handle value map to populate
superFlush - if true provide updates for all attributes; if false, only provide updates for the modified ones
Throws:
RTIinternalError - if an internal error occurs in the run-time infrastructure

addHLAbasicRepresentationListener

public void addHLAbasicRepresentationListener(HLAbasicRepresentationListener l)
Adds a listener for attributes associated with the HLAbasicRepresentation class.

Specified by:
addHLAbasicRepresentationListener in interface HLAbasicRepresentation
Parameters:
l - the listener to remove

removeHLAbasicRepresentationListener

public void removeHLAbasicRepresentationListener(HLAbasicRepresentationListener l)
Removes a listener for attributes associated with the HLAbasicRepresentation class.

Specified by:
removeHLAbasicRepresentationListener in interface HLAbasicRepresentation
Parameters:
l - the listener to remove

setSize

public void setSize(int pSize,
                    byte[] userSuppliedTag)
             throws ObjectInstanceNotKnown,
                    AttributeNotDefined,
                    AttributeNotOwned,
                    FederateNotExecutionMember,
                    SaveInProgress,
                    RestoreInProgress,
                    RTIinternalError
Sets the value of the size attribute.

Specified by:
setSize in interface HLAbasicRepresentation
Parameters:
pSize - the new attribute value
userSuppliedTag - a user-supplied tag to associate with the action
Throws:
ObjectInstanceNotKnown - if the object instance is unknown
AttributeNotDefined - if one of the attributes is undefined
AttributeNotOwned - if one of the attributes is not owned
FederateNotExecutionMember - if the federate is not a member of an execution
SaveInProgress - if a save operation is in progress
RestoreInProgress - if a restore operation is in progress
RTIinternalError - if an internal error occurred in the run-time infrastructure

getSize

public int getSize()
Returns the value of the size attribute.

Specified by:
getSize in interface HLAbasicRepresentation
Returns:
the current attribute value

setEndian

public void setEndian(HLAendianType pEndian,
                      byte[] userSuppliedTag)
               throws ObjectInstanceNotKnown,
                      AttributeNotDefined,
                      AttributeNotOwned,
                      FederateNotExecutionMember,
                      SaveInProgress,
                      RestoreInProgress,
                      RTIinternalError
Sets the value of the endian attribute.

Specified by:
setEndian in interface HLAbasicRepresentation
Parameters:
pEndian - the new attribute value
userSuppliedTag - a user-supplied tag to associate with the action
Throws:
ObjectInstanceNotKnown - if the object instance is unknown
AttributeNotDefined - if one of the attributes is undefined
AttributeNotOwned - if one of the attributes is not owned
FederateNotExecutionMember - if the federate is not a member of an execution
SaveInProgress - if a save operation is in progress
RestoreInProgress - if a restore operation is in progress
RTIinternalError - if an internal error occurred in the run-time infrastructure

getEndian

public HLAendianType getEndian()
Returns the value of the endian attribute.

Specified by:
getEndian in interface HLAbasicRepresentation
Returns:
the current attribute value

setInterpretation

public void setInterpretation(java.lang.String pInterpretation,
                              byte[] userSuppliedTag)
                       throws ObjectInstanceNotKnown,
                              AttributeNotDefined,
                              AttributeNotOwned,
                              FederateNotExecutionMember,
                              SaveInProgress,
                              RestoreInProgress,
                              RTIinternalError
Sets the value of the interpretation attribute.

Specified by:
setInterpretation in interface HLAbasicRepresentation
Parameters:
pInterpretation - the new attribute value
userSuppliedTag - a user-supplied tag to associate with the action
Throws:
ObjectInstanceNotKnown - if the object instance is unknown
AttributeNotDefined - if one of the attributes is undefined
AttributeNotOwned - if one of the attributes is not owned
FederateNotExecutionMember - if the federate is not a member of an execution
SaveInProgress - if a save operation is in progress
RestoreInProgress - if a restore operation is in progress
RTIinternalError - if an internal error occurred in the run-time infrastructure

getInterpretation

public java.lang.String getInterpretation()
Returns the value of the interpretation attribute.

Specified by:
getInterpretation in interface HLAbasicRepresentation
Returns:
the current attribute value

setEncoding

public void setEncoding(java.lang.String pEncoding,
                        byte[] userSuppliedTag)
                 throws ObjectInstanceNotKnown,
                        AttributeNotDefined,
                        AttributeNotOwned,
                        FederateNotExecutionMember,
                        SaveInProgress,
                        RestoreInProgress,
                        RTIinternalError
Sets the value of the encoding attribute.

Specified by:
setEncoding in interface HLAbasicRepresentation
Parameters:
pEncoding - the new attribute value
userSuppliedTag - a user-supplied tag to associate with the action
Throws:
ObjectInstanceNotKnown - if the object instance is unknown
AttributeNotDefined - if one of the attributes is undefined
AttributeNotOwned - if one of the attributes is not owned
FederateNotExecutionMember - if the federate is not a member of an execution
SaveInProgress - if a save operation is in progress
RestoreInProgress - if a restore operation is in progress
RTIinternalError - if an internal error occurred in the run-time infrastructure

getEncoding

public java.lang.String getEncoding()
Returns the value of the encoding attribute.

Specified by:
getEncoding in interface HLAbasicRepresentation
Returns:
the current attribute value