InfiniSQL  v0.1.2-alpha
Massive Scale Transaction Processing
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
MessageSocket Class Reference

Message variant for communicating socket events. More...

#include <Message.h>

Inheritance diagram for MessageSocket:
Collaboration diagram for MessageSocket:

Classes

struct  socket_s
 MessageSocket POD (serializable by memcpy) data members. More...
 

Public Member Functions

 MessageSocket ()
 
 MessageSocket (int socketarg, uint32_t eventsarg, listenertype_e listenertype, int64_t nodeidarg, topic_e topicarg)
 Message variant for communicating socket events. More...
 
virtual ~MessageSocket ()
 
size_t size ()
 get Message size More...
 
string * ser ()
 create string with serialized message More...
 
void package (class SerializedMessage &serobj)
 serialize this More...
 
void unpack (SerializedMessage &serobj)
 deserialize into this More...
 
void clear ()
 clear contents of this More...
 
- Public Member Functions inherited from Message
 Message ()
 
virtual ~Message ()
 
size_t size ()
 get Message size More...
 
std::string * ser ()
 create string with serialized message More...
 
void package (class SerializedMessage &serobj)
 serialize this More...
 
void unpack (SerializedMessage &serobj)
 deserialize into this More...
 
void clear ()
 clear contents of this More...
 
string * sermsg ()
 return serialized Message variant string More...
 
void setEnvelope (const Topology::addressStruct &source, const Topology::addressStruct &dest, class Message &msg)
 put addresses in Message variant envelope More...
 

Public Attributes

socket_s socketStruct
 
- Public Attributes inherited from Message
__int128 nextmsg
 
message_s messageStruct
 

Additional Inherited Members

- Static Public Member Functions inherited from Message
static class Messagedes (string *serstr)
 deserialize entire message More...
 

Detailed Description

Message variant for communicating socket events.

Returns

Definition at line 166 of file Message.h.

Constructor & Destructor Documentation

MessageSocket::MessageSocket ( )

Definition at line 205 of file Message.cc.

206 {
207 }
MessageSocket::MessageSocket ( int  socketarg,
uint32_t  eventsarg,
listenertype_e  listenertype,
int64_t  nodeidarg,
topic_e  topicarg 
)

Message variant for communicating socket events.

Parameters
socketargsocket discriptor
eventsargepoll events
listenertypetype of listener
nodeidargnodeid
topicargtopic

Definition at line 209 of file Message.cc.

211  :
212  socketStruct({socketarg, eventsarg, listenertypearg})
MessageSocket::~MessageSocket ( )
virtual

Definition at line 219 of file Message.cc.

220 {
221 }

Member Function Documentation

void MessageSocket::clear ( )

clear contents of this

Definition at line 252 of file Message.cc.

References Message::clear(), and socketStruct.

253 {
254  Message::clear();
255  socketStruct={};
256 }

Here is the call graph for this function:

void MessageSocket::package ( class SerializedMessage serobj)

serialize this

Parameters
serobjSerializedMessage

Definition at line 240 of file Message.cc.

References Message::package(), SerializedMessage::ser(), and socketStruct.

Referenced by ser().

241 {
242  Message::package(serobj);
243  serobj.ser(socketStruct);
244 }

Here is the call graph for this function:

Here is the caller graph for this function:

string * MessageSocket::ser ( )

create string with serialized message

Returns
serialized message string

Definition at line 228 of file Message.cc.

References SerializedMessage::data, SerializedMessage::getpayloadtype(), logfile, package(), and SerializedMessage::pos.

229 {
230  class SerializedMessage serobj(size());
231  package(serobj);
232  if (serobj.data->size() != serobj.pos)
233  {
234  fprintf(logfile, "%s %i ser %i size %lu pos %lu\n", __FILE__, __LINE__,
235  serobj.getpayloadtype(), serobj.data->size(), serobj.pos);
236  }
237  return serobj.data;
238 }

Here is the call graph for this function:

size_t MessageSocket::size ( )

get Message size

Returns
size in bytes

Definition at line 223 of file Message.cc.

References SerializedMessage::sersize(), Message::size(), and socketStruct.

224 {
226 }

Here is the call graph for this function:

void MessageSocket::unpack ( SerializedMessage serobj)

deserialize into this

Parameters
serobjSerializedMessage

Definition at line 246 of file Message.cc.

References SerializedMessage::des(), Message::messageStruct, and Message::unpack().

Referenced by Message::des().

247 {
248  Message::unpack(serobj);
249  serobj.des(messageStruct);
250 }

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

socket_s MessageSocket::socketStruct

Definition at line 225 of file Message.h.

Referenced by clear(), Pg::cont(), package(), size(), and TransactionAgent::TransactionAgent().


The documentation for this class was generated from the following files: