This repository has been archived by the owner on Jan 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgdOscMessage.h
64 lines (47 loc) · 1.63 KB
/
gdOscMessage.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include "core/reference.h"
#include "core/ustring.h"
#include "gdOscArg.h"
#ifndef _OSCMESSAGE_
#define _OSCMESSAGE_
#include "utils.h"
class gdOscMessage {
public:
gdOscMessage();
~gdOscMessage();
void clear();
void setAddress(const std::string& address);
void setTypetag(const std::string& typetag);
std::string getAddress() const;
std::string getRemoteIp() const;
std::string getTypetag() const;
void setRemoteEndpoint(const std::string& host, int port);
/// \return the remote host name/ip or "" if not set
std::string getRemoteHost() const;
/// \return the remote port or 0 if not set
int getRemotePort() const;
void addIntArg(int32_t arg);
void addFloatArg(float arg);
void addStringArg(String arg);
int32_t getArgAsInt32(int index, bool typeConvert = false) const;
float getArgAsFloat(int index, bool typeConvert = false) const;
std::string getArgAsString(int index, bool typeConvert = false) const;
int getNumArgs() const;
gdOscArgType getArgType(int index) const;
std::string getArgTypeName(int index) const;
gdOscMessage& copy(const gdOscMessage& other);
private:
std::string address; //< OSC address, must start with a /
// std::vector<ofxOscArg*> args; //< current arguments
std::string remoteHost; //< host name/ip the message was sent from
int remotePort; //< port the message was sent from
std::string typetag;
std::vector<gdOscArg*> args;
};
class OscExc {};
class OscExcInvalidArgumentType : public OscExc {};
class OscExcOutOfBounds : public OscExc {};
#endif