21# ifdef COMPILING_DLL_SimulatedRealityCore
22# define DIMENCOSR_API __declspec(dllexport)
24# define DIMENCOSR_API __declspec(dllimport)
89#pragma warning(disable: 4251)
90 std::map<std::string, std::vector<WorldObject*>> worldObjects;
91 std::map<std::string, std::vector<Sense*>> senses;
92 std::unique_ptr<Configuration> configuration;
95 void calibrateAllSenses();
96 void startAllSenses();
98 void deleteAllSenses();
111 void construct(NetworkMode mode, std::string address, std::string port,
bool lensPreference);
174 SRContext(
bool lensPreference, std::string serverAddress,
NetworkMode mode = NetworkMode::NonBlockingClientMode);
256 const std::vector<WorldObject*>&
getObjects(std::string interfaceIdentifier);
280 const std::vector<Sense*>&
getSenses(std::string interfaceIdentifier);
Class representing the configuration of the SRContext.
Definition: srconfiguration.h:47
Interface defining how to send messages between SR applications.
Definition: networkinterface.h:29
Interface to be used to enable receiving SR_packet from other SR applications.
Definition: receiver.h:30
Maintains WorldObject and Sense objects during the application lifetime.
Definition: srcontext.h:80
const NetworkMode mode
Affects which implementation of a certain interface will be constructed when the associated create fu...
Definition: srcontext.h:117
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:101
@ StandaloneMode
ClientMode if server is reachable, ServerMode behaviour otherwise.
Definition: srcontext.h:106
@ ClientMode
Receive data from server, keep connecting to server until available.
Definition: srcontext.h:104
@ ServerMode
Send data to client.
Definition: srcontext.h:103
@ EdgeMode
Identical to ServerMode.
Definition: srcontext.h:102
@ HybridMode
Same as StandAlone mode.
Definition: srcontext.h:105
@ NonBlockingClientMode
Try to connect to server once, throw exception otherwise.
Definition: srcontext.h:107
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:42
Class representing both real and virtual objects as nodes in the World tree.
Definition: worldobject.h:35
SR_contextMessageType
Enumeration of SR_contextMessage types.
Definition: srcontext.h:35
@ Initialize
Definition: srcontext.h:36
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:25
#define DIMENCOSR_API
Definition: srcontext.h:27
C-compatible struct to signal the SR context.
Definition: srcontext.h:46
SR_contextMessageType type
Definition: srcontext.h:47
C-compatible struct for communication between SR applications.
Definition: packet.h:25