16# ifdef COMPILING_DLL_SimulatedRealityCore
17# define DIMENCOSR_API __declspec(dllexport)
19# define DIMENCOSR_API __declspec(dllimport)
84#pragma warning(disable: 4251)
85 std::map<std::string, std::vector<WorldObject*>> worldObjects;
86 std::map<std::string, std::vector<Sense*>> senses;
87 std::unique_ptr<Configuration> configuration;
90 void calibrateAllSenses();
91 void startAllSenses();
93 void deleteAllSenses();
106 void construct(NetworkMode mode, std::string address, std::string port,
bool lensPreference);
169 SRContext(
bool lensPreference, std::string serverAddress,
NetworkMode mode = NetworkMode::NonBlockingClientMode);
251 const std::vector<WorldObject*>&
getObjects(std::string interfaceIdentifier);
275 const std::vector<Sense*>&
getSenses(std::string interfaceIdentifier);
Class representing the configuration of the SRContext.
Definition: srconfiguration.h:42
Interface defining how to send messages between SR applications.
Definition: networkinterface.h:24
Interface to be used to enable receiving SR_packet from other SR applications.
Definition: receiver.h:25
Maintains WorldObject and Sense objects during the application lifetime.
Definition: srcontext.h:75
const NetworkMode mode
Affects which implementation of a certain interface will be constructed when the associated create fu...
Definition: srcontext.h:112
SRContext(bool lensPreference, std::string serverAddress, NetworkMode mode=NetworkMode::NonBlockingClientMode)
Construct the SRContext.
virtual void receive(SR_packet &packet) override
Receives SR_packet sent over network to control remote instances of SRContext.
const std::vector< Sense * > & getSenses(std::string interfaceIdentifier)
Get all registered senses of the given interface.
const Configuration & getConfiguration()
Get configuration information.
void addObject(std::string interfaceIdentifier, WorldObject *worldObject)
Register a world object of the given interface with the context.
void initialize()
Initialize all senses.
~SRContext()
Clean up the SRContext and associated world.
static SRContext * create(bool lensPreference, NetworkMode mode=NetworkMode::NonBlockingClientMode)
create new SRContext instance
static SRContext * create(bool lensPreference, const char *serverAddress, NetworkMode mode=NetworkMode::NonBlockingClientMode)
create new SRContext instance
const std::vector< WorldObject * > & getObjects(std::string interfaceIdentifier)
Get all registered world objects of the given interface.
static SRContext * create(const char *serverAddress, NetworkMode mode=NetworkMode::NonBlockingClientMode)
create new SRContext instance
SRContext(NetworkMode mode=NetworkMode::NonBlockingClientMode)
Construct the SRContext.
void removeSense(std::string interfaceIdentifier, Sense *sense)
Unregister a sense of the given interface from the context.
void setOther(uint64_t srContext)
set remote SRContext to communicate with
virtual void print(SR_packet &packet) override
Prints text representation of SR_packet containing eye position updates sent over network.
static void deleteSRContext(SRContext *context)
delete SRContext instance
SRContext(bool lensPreference, NetworkMode mode=NetworkMode::NonBlockingClientMode)
Construct the SRContext.
NetworkMode
Definition: srcontext.h:96
@ StandaloneMode
ClientMode if server is reachable, ServerMode behaviour otherwise.
Definition: srcontext.h:101
@ ClientMode
Receive data from server, keep connecting to server until available.
Definition: srcontext.h:99
@ ServerMode
Send data to client.
Definition: srcontext.h:98
@ EdgeMode
Identical to ServerMode.
Definition: srcontext.h:97
@ HybridMode
Same as StandAlone mode.
Definition: srcontext.h:100
@ NonBlockingClientMode
Try to connect to server once, throw exception otherwise.
Definition: srcontext.h:102
static SRContext * create(NetworkMode mode=NetworkMode::NonBlockingClientMode)
create new SRContext instance
SRContext(std::string serverAddress, NetworkMode mode=NetworkMode::NonBlockingClientMode)
Construct the SRContext.
void addSense(std::string interfaceIdentifier, Sense *sense)
Register a sense of the given interface with the context.
Class of objects dealing with Streams of data.
Definition: sense.h:37
Class representing both real and virtual objects as nodes in the World tree.
Definition: worldobject.h:30
SR_contextMessageType
Enumeration of SR_contextMessage types.
Definition: srcontext.h:30
@ Initialize
Definition: srcontext.h:31
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:20
#define DIMENCOSR_API
Definition: srcontext.h:22
C-compatible struct to signal the SR context.
Definition: srcontext.h:41
SR_contextMessageType type
Definition: srcontext.h:42
C-compatible struct for communication between SR applications.
Definition: packet.h:20