Пример #1
0
void NetStreamSender::addEdge(const string & source_id, long time_id, const string & edge_id, const string & from_node, const string & to_node, bool directed){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_ADD_EDGE);
  event.writeString(source_id);
  event.writeLong(time_id);
  event.writeString(edge_id);
  event.writeString(from_node);
  event.writeString(to_node);
  event.writeByte(directed?1:0);
  _sendEvent(event);
}
void NetStreamSender::addEdge(const GS_STRING & source_id, GS_LONG time_id, const GS_STRING & edge_id, const GS_STRING & from_node, const GS_STRING & to_node, GS_BOOL directed){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_ADD_EDGE);
  event.writeString(source_id);
  event.writeUnsignedVarInt(time_id);
  event.writeString(edge_id);
  event.writeString(from_node);
  event.writeString(to_node);
  event.writeByte(directed?1:0);
  _sendEvent(event);
}
Пример #3
0
void NetStreamSender::graphClear(const string & source_id, long time_id){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_CLEARED);
  event.writeString(source_id);
  event.writeLong(time_id);
  _sendEvent(event);  
}
void NetStreamSender::graphClear(const GS_STRING & source_id, GS_LONG time_id){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_CLEARED);
  event.writeString(source_id);
  event.writeUnsignedVarInt(time_id);
  _sendEvent(event);  
}
Пример #5
0
void NetStreamSender::removeGraphAttribute(const string & source_id, long time_id, const string & attribute){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_DEL_GRAPH_ATTR);
  event.writeString(source_id);
  event.writeLong(time_id);
  event.writeString(attribute);
  _sendEvent(event);
}
Пример #6
0
void NetStreamSender::stepBegins(const string & source_id, long time_id, double timestamp){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_STEP);
  event.writeString(source_id);
  event.writeLong(time_id);
  event.writeDouble(timestamp);
  _sendEvent(event);
}
Пример #7
0
void NetStreamSender::removeEdge(const string & source_id, long time_id, const string & edge_id){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_DEL_EDGE);
  event.writeString(source_id);
  event.writeLong(time_id);
  event.writeString(edge_id);
  _sendEvent(event);
}
Пример #8
0
// ==================
// = Element events =
// ================== 
void NetStreamSender::addNode(const string & source_id, long time_id, const string & node_id){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_ADD_NODE);
  event.writeString(source_id);
  event.writeLong(time_id);
  event.writeString(node_id);
  _sendEvent(event);
}
void NetStreamSender::removeGraphAttribute(const GS_STRING & source_id, GS_LONG time_id, const GS_STRING & attribute){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_DEL_GRAPH_ATTR);
  event.writeString(source_id);
  event.writeUnsignedVarInt(time_id);
  event.writeString(attribute);
  _sendEvent(event);
}
void NetStreamSender::stepBegins(const GS_STRING & source_id, GS_LONG time_id, GS_DOUBLE timestamp){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_STEP);
  event.writeString(source_id);
  event.writeUnsignedVarInt(time_id);
  event.writeDouble(timestamp);
  _sendEvent(event);
}
void NetStreamSender::removeEdge(const GS_STRING & source_id, GS_LONG time_id, const GS_STRING & edge_id){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_DEL_EDGE);
  event.writeString(source_id);
  event.writeUnsignedVarInt(time_id);
  event.writeString(edge_id);
  _sendEvent(event);
}
// ==================
// = Element events =
// ================== 
void NetStreamSender::addNode(const GS_STRING & source_id, GS_LONG time_id, const GS_STRING & node_id){
  NetStreamStorage event = NetStreamStorage();
  event.writeByte(EVENT_ADD_NODE);
  event.writeString(source_id);
  event.writeUnsignedVarInt(time_id);
  event.writeString(node_id);
  _sendEvent(event);
}
Пример #13
0
void NetStreamSender::_encode(NetStreamStorage & event, const vector<bool> & value){
  event.writeInt(value.size());
  for(vector<bool>::const_iterator i = value.begin(); i != value.end(); i++){
    event.writeByte((*i));
  }
}
Пример #14
0
void NetStreamSender::_encode(NetStreamStorage & event, bool value){
  event.writeByte(value?1:0);
}
Пример #15
0
// =================
// = data encoding =
// =================
void NetStreamSender::_encode(NetStreamStorage & event, char value){
  event.writeByte((int)value);
}
// =================
// = data encoding =
// =================
void NetStreamSender::_encode(NetStreamStorage & event, GS_CHAR value){
  event.writeByte((GS_INT)value);
}