AGXDynamics  2.35.0.2
CoSimulationClient.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 #pragma once
18 
20 #include <agx/agx_vector_types.h>
21 
22 
23 namespace agxSDK
24 {
25  class Simulation;
26 }
27 
28 namespace agxNet
29 {
30 
33  {
34  public:
39  CoSimulationClient( const IPAddress& address );
40 
41  agx::String getMessage();
42 
43  bool checkConnection();
44 
45  void setTimeStep(double timeStep);
46 
53  bool preloadScript(const agx::String& filename);
54 
55  bool initInput(const agx::RealVector& input, agx::RealVector& output);
56 
57  bool stepInput(const agx::RealVector& input, agx::RealVector& output);
58 
60  bool isWaitingForConnection() const;
61 
62  virtual bool waitForConnection();
63 
64  protected:
65 
66  bool connectToServer();
67 
68  virtual void handleConnectionDrop();
69 
70  virtual ~CoSimulationClient();
71 
72  private:
73  IPAddress m_address;
74  bool m_isWaitingForConnection;
75  agx::Timer stepTimer;
76 
77  };
78 
79 }
CoSimulationBase.h
agx::VectorPOD< Real >
AGXPHYSICS_EXPORT
#define AGXPHYSICS_EXPORT
agxNet::IPAddress
a structure which holds IP address
Definition: Socket.h:116
agx::Referenced
Base class providing referencing counted objects.
Definition: Referenced.h:113
agx::Timer
The Timer class permits timing execution speed with the same refinement as the built in hardware cloc...
Definition: Timer.h:74
agxNet::CoSimulationClient
Class for receiving serialized agxSDK::Simulation:s from remote host.
Definition: CoSimulationClient.h:32
agxNet::CoSimulationBase
Base class for multi threaded transferring simulation between a server and a client using sockets.
Definition: CoSimulationBase.h:34
agx::AgXString< std::string >
agxSDK
The agxSDK namespace contain classes to bridge the collision detection system and the dynamical simul...
Definition: Constraint.h:30
agx_vector_types.h
agxNet
Containins classes for sending/reading data over sockets as well as compression functionality.
Definition: MacUtil.h:22