12 #ifndef ROOT_MPSendRecv 13 #define ROOT_MPSendRecv 20 #include <type_traits> 31 using MPCodeBufPair = std::pair<unsigned, std::unique_ptr<TBufferFile>>;
41 template<class T, typename std::enable_if<std::is_class<T>::value>
::type * =
nullptr>
44 template < class T, typename std::enable_if < !std::is_class<T>::value &&!std::is_pointer<T>::value >
::type * =
nullptr >
47 template<class T, typename std::enable_if<std::is_same<const char *, T>::value>
::type * =
nullptr>
50 template < class T, typename std::enable_if < std::is_pointer<T>::value &&std::is_constructible<TObject *, T>::value >
::type * =
nullptr >
57 template<class T, typename std::enable_if<std::is_class<T>::value>
::type * =
nullptr>
61 template < class T, typename std::enable_if < !std::is_class<T>::value &&!std::is_pointer<T>::value >
::type * =
nullptr >
65 template<class T, typename std::enable_if<std::is_same<const char *, T>::value>
::type * =
nullptr>
69 template < class T, typename std::enable_if < std::is_pointer<T>::value &&std::is_constructible<TObject *, T>::value >
::type * =
nullptr >
90 template<class T, typename std::enable_if<std::is_class<T>::value>
::type *>
95 Error(
"MPSend",
"[E] Could not find cling definition for class %s\n",
typeid(
T).
name());
110 template < class T, typename std::enable_if < !std::is_class<T>::value &&!std::is_pointer<T>::value >
::type * >
115 wBuf << code << size << obj;
121 template<class T, typename std::enable_if<std::is_same<const char *, T>::value>
::type *>
132 template < class T, typename std::enable_if < std::is_pointer<T>::value && std::is_constructible<TObject *, T>::value >
::type * >
156 template<class T, typename std::enable_if<std::is_class<T>::value>
::type *>
167 template < class T, typename std::enable_if < !std::is_class<T>::value &&!std::is_pointer<T>::value >
::type * >
176 template<class T, typename std::enable_if<std::is_same<const char *, T>::value>
::type *>
185 template < class T, typename std::enable_if < std::is_pointer<T>::value &&std::is_constructible<TObject *, T>::value >
::type * >
virtual void WriteString(const char *s)
Write string to I/O buffer.
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
T ReadBuffer(TBufferFile *buf)
One of the template functions used to read objects from messages.
int MPSend(TSocket *s, unsigned code)
Send a message with the specified code on the specified socket.
virtual void * ReadObjectAny(const TClass *cast)
Read object from I/O buffer.
virtual void WriteULong(ULong_t l)
virtual Int_t SendRaw(const void *buffer, Int_t length, ESendRecvOptions opt=kDefault)
Send a raw buffer of specified length.
virtual char * ReadString(char *s, Int_t max)
Read string from I/O buffer.
void Error(const char *location, const char *msgfmt,...)
virtual void WriteUInt(UInt_t i)
std::pair< unsigned, std::unique_ptr< TBufferFile > > MPCodeBufPair
An std::pair that wraps the code and optional object contained in a message.
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse=kTRUE)
Write object to I/O buffer.
The ROOT global object gROOT contains a list of all defined classes.
virtual void WriteBuf(const void *buf, Int_t max)
Write max bytes from buf into the I/O buffer.
static constexpr double s
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
MPCodeBufPair MPRecv(TSocket *s)
Receive message from a socket.