AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxNet::CoSimulationClient Class Reference

Class for receiving serialized agxSDK::Simulation:s from remote host. More...

#include <CoSimulationClient.h>

+ Inheritance diagram for agxNet::CoSimulationClient:

Public Member Functions

 CoSimulationClient (const IPAddress &address)
 Constructor.
 
bool checkConnection ()
 
agx::String getMessage ()
 
bool initInput (const agx::RealVector &input, agx::RealVector &output)
 
bool isWaitingForConnection () const
 Is the client still waiting for connection?
 
bool preloadScript (const agx::String &filename)
 Preloads the scene, parsing the file and obtaining information about input and output sizes.
 
void setTimeStep (double timeStep)
 
bool stepInput (const agx::RealVector &input, agx::RealVector &output)
 
virtual bool waitForConnection ()
 
- Public Member Functions inherited from agxNet::CoSimulationBase
 CoSimulationBase ()
 Default constructor.
 
virtual void dropConnection (bool shouldShutdown=false)
 Drop the connection to the remote host and wait for a new one.
 
virtual bool isConnected ()
 
virtual bool waitForConnection ()=0
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 

Protected Member Functions

virtual ~CoSimulationClient ()
 
bool connectToServer ()
 
virtual void handleConnectionDrop ()
 
- Protected Member Functions inherited from agxNet::CoSimulationBase
virtual ~CoSimulationBase ()
 
virtual void handleConnectionDrop ()
 
size_t receiveData (uint8_t *data, size_t numBytes)
 Receive data from remote party.
 
void receivePacket (Header &header)
 
size_t sendData (const uint8_t *data, size_t numBytes)
 Transmit data to remote party.
 
void sendPacket (Header &header)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agxNet::CoSimulationBase
agx::Vector< char > m_buffer
 
agx::Mutex m_connectionMutex
 
bool m_isShutdown
 
TCPSocketRef m_socket
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Class for receiving serialized agxSDK::Simulation:s from remote host.

Definition at line 32 of file CoSimulationClient.h.

Constructor & Destructor Documentation

◆ CoSimulationClient()

agxNet::CoSimulationClient::CoSimulationClient ( const IPAddress &  address)

Constructor.

Parameters
address- Address of server running a simulation

◆ ~CoSimulationClient()

virtual agxNet::CoSimulationClient::~CoSimulationClient ( )
protectedvirtual

Member Function Documentation

◆ checkConnection()

bool agxNet::CoSimulationClient::checkConnection ( )

◆ connectToServer()

bool agxNet::CoSimulationClient::connectToServer ( )
protected

◆ getMessage()

agx::String agxNet::CoSimulationClient::getMessage ( )

◆ handleConnectionDrop()

virtual void agxNet::CoSimulationClient::handleConnectionDrop ( )
protectedvirtual

Reimplemented from agxNet::CoSimulationBase.

◆ initInput()

bool agxNet::CoSimulationClient::initInput ( const agx::RealVector &  input,
agx::RealVector &  output 
)

◆ isWaitingForConnection()

bool agxNet::CoSimulationClient::isWaitingForConnection ( ) const

Is the client still waiting for connection?

◆ preloadScript()

bool agxNet::CoSimulationClient::preloadScript ( const agx::String &  filename)

Preloads the scene, parsing the file and obtaining information about input and output sizes.

Parameters
filenameThe name of the script (python or lua) file. Has to have a buildScene(sim, app) function.
Return values
Hasthe loading succeeded?

◆ setTimeStep()

void agxNet::CoSimulationClient::setTimeStep ( double  timeStep)

◆ stepInput()

bool agxNet::CoSimulationClient::stepInput ( const agx::RealVector &  input,
agx::RealVector &  output 
)

◆ waitForConnection()

virtual bool agxNet::CoSimulationClient::waitForConnection ( )
virtual

The documentation for this class was generated from the following file: