68iOSWhiteboard::iOSWhiteboard()
70 int udp_id = getplayernumber();
72 if(udp_id > (NUM_OF_BROADCASTERS))
74 fprintf(stderr,
"Bad UDP_ID passed in, exiting...\n\n");
78 udp_id = FAKE_BROADCAST;
85 gettimeofday(&tim, NULL);
89 fprintf(stderr,
"\n\nMessages to a packet: %d\nPackets to send all messages: %d\nHashes to a packet: %d\nPackets to send all hashes: %d\nInjections to a packet: %d\n\nCYCLES_PER_SECOND: %d\nPACKETS_PER_TS_INTERVAL %d\n", MESSAGES_PER_PACKET, TOTAL_MESSAGE_PACKETS, HASHES_PER_PACKET, TOTAL_HASH_PACKETS, INJECTIONS_PER_PACKET, CYCLES_PER_SEC, PACKETS_PER_TS_INTERVAL);
91 fprintf(stderr,
"\nMessages sizes:\n\tgsw_single_message:\t%d\n\tgsw_hash_message:\t%d\n\n", (
int)
sizeof(gsw_single_message), (
int)
sizeof(gsw_hash_message));
97 BridgeBroadcaster *broadcaster =
new BridgeBroadcaster(NULL, NULL, &dynamic_messages_to_inject, &injection_mutex, tim);
141 for (std::vector<int>::const_iterator i = value->
getArrayValue().begin(); i < value->getArrayValue().end(); i++)
178 vector<int> *v =
new vector<int>();
179 for (
int i = 0; i < m->
wbmsg.
len; i++)
180 v->push_back(m->
ivec[i]);
181 return WBMsg(*v,
true);
191 gsw_injection_message msg;
192 msg.machineId = machine;
194 strcpy(msg.type.hash.string, (
char *)type.c_str());
196 convWBMsgToSimpleMsg((
WBMsg *)&value, &msg.m);
199 fprintf(stderr,
"Machine: %d\tType %s\tContent %s\n", (msg.machineId+1), msg.type.hash.string, (
char *)msg.m.wbmsg.data);
201 pthread_mutex_lock(&injection_mutex);
202 dynamic_messages_to_inject.push_back(msg);
203 pthread_mutex_unlock(&injection_mutex);
Old WB class for storing shared data.
const std::string & getStringValue() const
getStringValue.
int getIntValue() const
getIntValue.
const std::vector< int > & getArrayValue() const
getArrayValue.
float getFloatValue() const
getFloatValue.
WBType getType() const
getType.
const void * getBinaryValue() const
getBinaryValue.
int getSizeInBytes() const
getSizeInBytes.
bool getBoolValue() const
getBoolValue.
~iOSWhiteboard()
Destructor.
WBMsg getMessage(std::string type, RWBMachine machine, WBResult *result=NULL)
Get Message Gets a message from a remote simple whiteboard.
void addReplicationType(const std::string &type, RWBMachine machine)
Add Message Adds a message to the whiteboard that the API is connected to.
void injectRemoteMessage(const std::string &type, const WBMsg &msg, RWBMachine machine)
Inject Message Adds a message to a remote whiteboard that the API is connected to.
std::vector< std::string > getKnownTypesForMachine(RWBMachine machine)
Get Known Types For Machine Gets all the currently known types for a machine.
enum guWhiteboard::iOSWhiteboard::wb_method_result WBResult
Return Type Enum.
enum guWhiteboard::iOSWhiteboard::remote_wb_id RWBMachine
Remote WB enum.
union type that is used to store data in shared memory
int ivec[128/sizeof(int)]
int array
struct gsw_simple_message::@4 wbmsg
compatibility WBMsg type