Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
JNET Namespace Reference

Classes

class  JClient
 ControlHost client manager. More...
 
class  JClientList
 List of ControlHost client managers. More...
 
class  JControlHost
 ControlHost class. More...
 
class  JControlHostObjectIterator
 Object iteration through ControlHost. More...
 
class  JControlHostObjectOutput
 Implemenation of object output through ControlHost. More...
 
class  JControlHostObjectOutput< JTypeList< JHead_t, JNullType > >
 Terminator class of recursive JControlHostObjectOutput class. More...
 
class  JControlHostObjectOutput< JTypeList< JHead_t, JTail_t > >
 Implementation of object output for multiple data types. More...
 
class  JControlHostServer
 Light-weight wrapper class around server socket. More...
 
class  JDispatch
 Data structure of a ControlHost message. More...
 
struct  JHostname
 Auxiliary data structure for hostname and port number. More...
 
class  JLigierObjectIterator
 Object iteration through ControlHost server. More...
 
class  JMemory_t
 
class  JPrefix
 ControlHost prefix. More...
 
class  JSelect
 Wrapper class for select call. More...
 
class  JSelectReader
 Wrapper class for select call. More...
 
class  JSelectWriter
 Wrapper class for select call. More...
 
class  JServerSocket
 TCP server socket. More...
 
class  JSocket
 Socket class. More...
 
class  JSocketAddress
 The JSocketAddress class encapsulates the sockaddr_in data structure. More...
 
class  JSocketBlocking
 Blocking socket I/O. More...
 
class  JSocketBuffer
 Auxiliary class for non-blocking socket I/O. More...
 
class  JSocketChannel
 Auxiliary class for socket channel. More...
 
class  JSocketInputChannel
 Socket input channel. More...
 
class  JSocketNonblockingReader
 Non-blocking socket reader. More...
 
class  JSocketNonblockingWriter
 Non-blocking socket writer. More...
 
class  JSocketOutputChannel
 Socket output channel. More...
 
class  JSocketStatus
 Auxiliary class for non-blocking socket I/O. More...
 
class  JSubscription
 ControlHost subscription. More...
 
struct  JSubscriptionAll
 Auxiliary class for all subscription. More...
 
struct  JSubscriptionAny
 Auxiliary class for any subscription. More...
 
class  JSubscriptionList
 Subscription list. More...
 
class  JTag
 ControlHost tag. More...
 
class  JTCPSocket
 TCP socket. More...
 
class  JUDPSocket
 UDP socket. More...
 

Typedefs

typedef JControlHost ControlHost
 Match name.
 
typedef JControlHostServer ControlServ
 Match name.
 
typedef JPrefix JPrefix_t
 
typedef JSocketInputChannel< JPrefix_tJSocketInputChannel_t
 
typedef JSocketBuffer< char > JSocketInputBuffer
 
typedef JSocketBuffer< const char > JSocketOutputBuffer
 
typedef long long int JTag_t
 Type definition of numerical ControlHost tag.
 

Enumerations

enum  JSubscription_t { SUBSCRIBE_ALL = 'a' , SUBSCRIBE_ANY = 'w' }
 ControlHost subscription types. More...
 

Functions

template<>
int getSizeOfPacket (const KM3NETDAQ::JDAQAbstractPreamble &preamble)
 Get size of packeet.
 
JSubscriptionList operator+ (const JSubscription &first, const JSubscription &second)
 Add operator.
 
int getSizeOfPacket (const JPrefix_t &prefix)
 Get total size of internet packet.
 
void setSizeOfPacket (const int size, JPrefix_t &prefix)
 Set total size of internet packet.
 
std::ostream & operator<< (std::ostream &out, const JDispatch &message)
 Print message.
 
std::ostream & operator<< (std::ostream &out, const JSocket &socket)
 Print socket.
 
std::ostream & operator<< (std::ostream &out, const JSocketStatus &status)
 Print socket status.
 
std::ostream & operator<< (std::ostream &out, const JSocketInputBuffer &buffer)
 Print socket input buffer.
 
template<class JPrefix_t >
int getSizeOfPacket (const JPrefix_t &prefix)
 Get size of data, including the header.
 
template<class JPrefix_t >
void setSizeOfPacket (const int size, JPrefix_t &prefix)
 Set size of data, including the header.
 
bool operator< (const JTag &first, const JTag &second)
 Less than operator for JTag.
 
bool operator== (const JTag &first, const JTag &second)
 Equal operator for JTag.
 
bool operator!= (const JTag &first, const JTag &second)
 Not equal operator for JTag.
 

Variables

static const std::string CHOO_VERSION = "1.0"
 
static const int DISPATCH_PORT = 5553
 Default ControlHost port.
 
static const size_t TAGSIZE = sizeof(JTag_t)
 Size of ControlHost tag.
 
static const JTag DISPTAG_Subscribe ("_Subscri")
 Special ControlHost tags.
 
static const JTag DISPTAG_Gime ("_Gime")
 
static const JTag DISPTAG_Always ("_Always")
 
static const JTag DISPTAG_MyId ("_MyId")
 
static const JTag DISPTAG_Born ("Born")
 
static const JTag DISPTAG_Died ("Died")
 
static const JTag DISPTAG_ShowStat ("_ShowSta")
 
static const JTag DISPTAG_WhereIs ("_WhereIs")
 
static const JTag DISPTAG_Version ("_Version")
 
static const JTag DISPTAG_Debug ("_Debug")
 
static const JTag DISPTAG_UNDEFINED (0)
 

Detailed Description

Author
mdejong
cpellegrino, mdejong

Typedef Documentation

◆ ControlHost

Match name.

Definition at line 698 of file JControlHost.hh.

◆ ControlServ

Match name.

Definition at line 70 of file JControlHostServer.hh.

◆ JPrefix_t

Definition at line 29 of file JLigier.cc.

◆ JSocketInputChannel_t

Definition at line 30 of file JLigier.cc.

◆ JSocketInputBuffer

Definition at line 109 of file JSocketNonblocking.hh.

◆ JSocketOutputBuffer

Definition at line 110 of file JSocketNonblocking.hh.

◆ JTag_t

typedef long long int JNET::JTag_t

Type definition of numerical ControlHost tag.

Definition at line 31 of file JTag.hh.

Enumeration Type Documentation

◆ JSubscription_t

ControlHost subscription types.

Enumerator
SUBSCRIBE_ALL 
SUBSCRIBE_ANY 

Definition at line 40 of file JControlHost.hh.

40 {
41 SUBSCRIBE_ALL = 'a',
42 SUBSCRIBE_ANY = 'w'
43 //SUBSCRIBE_SHARED_MEMORY = 'm'
44 };
@ SUBSCRIBE_ANY
@ SUBSCRIBE_ALL

Function Documentation

◆ getSizeOfPacket() [1/3]

template<>
int JNET::getSizeOfPacket ( const KM3NETDAQ::JDAQAbstractPreamble & preamble)
inline

Get size of packeet.

Parameters
preambleDAQ data preamble
Returns
size [B]

Definition at line 82 of file JDataFilter.cc.

83 {
84 return preamble.getLength();
85 }

◆ operator+()

JSubscriptionList JNET::operator+ ( const JSubscription & first,
const JSubscription & second )
inline

Add operator.

Parameters
firstsubscription
secondsubscription
Returns
subscription list

Definition at line 234 of file JControlHost.hh.

235 {
236 JSubscriptionList buffer;
237
238 buffer.add(first);
239 buffer.add(second);
240
241 return buffer;
242 }
Subscription list.
JSubscriptionList & add(const JSubscription &subscription)
Add subscription.

◆ getSizeOfPacket() [2/3]

int JNET::getSizeOfPacket ( const JPrefix_t & prefix)
inline

Get total size of internet packet.

Parameters
prefixprefix
Returns
number of bytes

Definition at line 39 of file JLigier.cc.

40 {
41 return prefix.getSize() + sizeof(JPrefix_t);
42 }
ControlHost prefix.
Definition JPrefix.hh:33
int getSize() const
Get size.
Definition JPrefix.hh:62

◆ setSizeOfPacket() [1/2]

void JNET::setSizeOfPacket ( const int size,
JPrefix_t & prefix )
inline

Set total size of internet packet.

Parameters
sizenumber of bytes
prefixprefix

Definition at line 51 of file JLigier.cc.

52 {
53 prefix.setSize(size - sizeof(JPrefix_t));
54 }
void setSize(const long long int length)
Set size.
Definition JPrefix.hh:73

◆ operator<<() [1/4]

std::ostream & JNET::operator<< ( std::ostream & out,
const JDispatch & message )
inline

Print message.

Parameters
outoutput stream
messagemessage
Returns
output stream

Definition at line 521 of file JLigier.cc.

522 {
523 return out << "(" << message.getTag() << "," << message.size() << ")";
524 }
int size() const
Get size.
Definition JLigier.cc:188
const JTag & getTag() const
Get tag.
Definition JTag.hh:86

◆ operator<<() [2/4]

std::ostream & JNET::operator<< ( std::ostream & out,
const JSocket & socket )
inline

Print socket.

Parameters
outoutput stream
socketsocket
Returns
output stream

Definition at line 534 of file JLigier.cc.

535 {
536 return out << "[" << socket.getFileDescriptor() << "]";
537 }
int getFileDescriptor() const
Get file descriptor.

◆ operator<<() [3/4]

std::ostream & JNET::operator<< ( std::ostream & out,
const JSocketStatus & status )
inline

Print socket status.

Parameters
outoutput stream
statussocket status
Returns
output stream

Definition at line 547 of file JLigier.cc.

548 {
549 return out << "(" << status.isReady() << "," << status.getCounter() << ")";
550 }
int getCounter() const
Get number of I/O attempts.
bool isReady() const
Check ready status.

◆ operator<<() [4/4]

std::ostream & JNET::operator<< ( std::ostream & out,
const JSocketInputBuffer & buffer )
inline

Print socket input buffer.

Parameters
outoutput stream
buffersocket buffer
Returns
output stream

Definition at line 560 of file JLigier.cc.

561 {
562 return out << "(" << buffer.isReady() << "," << buffer.getCounter() << "," << buffer.getSize() << ")";
563 }
int getSize() const
Get size of pending data.

◆ getSizeOfPacket() [3/3]

template<class JPrefix_t >
int JNET::getSizeOfPacket ( const JPrefix_t & prefix)

Get size of data, including the header.

This method should be implemented for each template class for read operations.

Parameters
prefixprefix
Returns
number of bytes

◆ setSizeOfPacket() [2/2]

template<class JPrefix_t >
void JNET::setSizeOfPacket ( const int size,
JPrefix_t & prefix )

Set size of data, including the header.

This method should be implemented for each template class for write operations.

Parameters
sizenumber of bytes
prefixprefix

◆ operator<()

bool JNET::operator< ( const JTag & first,
const JTag & second )
inline

Less than operator for JTag.

Parameters
firsttag
secondtag
Returns

Definition at line 265 of file JTag.hh.

266 {
267 return first.getID() < second.getID();
268 }
JTag_t getID() const
Get identifier.
Definition JTag.hh:160

◆ operator==()

bool JNET::operator== ( const JTag & first,
const JTag & second )
inline

Equal operator for JTag.

Parameters
firsttag
secondtag
Returns

Definition at line 278 of file JTag.hh.

279 {
280 return first.getID() == second.getID();
281 }

◆ operator!=()

bool JNET::operator!= ( const JTag & first,
const JTag & second )
inline

Not equal operator for JTag.

Parameters
firsttag
secondtag
Returns

Definition at line 291 of file JTag.hh.

292 {
293 return first.getID() != second.getID();
294 }

Variable Documentation

◆ CHOO_VERSION

const std::string JNET::CHOO_VERSION = "1.0"
static

Definition at line 34 of file JControlHost.hh.

◆ DISPATCH_PORT

const int JNET::DISPATCH_PORT = 5553
static

Default ControlHost port.

Definition at line 27 of file JHostname.hh.

◆ TAGSIZE

const size_t JNET::TAGSIZE = sizeof(JTag_t)
static

Size of ControlHost tag.

Definition at line 32 of file JTag.hh.

◆ DISPTAG_Subscribe

const JTag JNET::DISPTAG_Subscribe("_Subscri") ( "_Subscri" )
static

Special ControlHost tags.

◆ DISPTAG_Gime

const JTag JNET::DISPTAG_Gime("_Gime") ( "_Gime" )
static

◆ DISPTAG_Always

const JTag JNET::DISPTAG_Always("_Always") ( "_Always" )
static

◆ DISPTAG_MyId

const JTag JNET::DISPTAG_MyId("_MyId") ( "_MyId" )
static

◆ DISPTAG_Born

const JTag JNET::DISPTAG_Born("Born") ( "Born" )
static

◆ DISPTAG_Died

const JTag JNET::DISPTAG_Died("Died") ( "Died" )
static

◆ DISPTAG_ShowStat

const JTag JNET::DISPTAG_ShowStat("_ShowSta") ( "_ShowSta" )
static

◆ DISPTAG_WhereIs

const JTag JNET::DISPTAG_WhereIs("_WhereIs") ( "_WhereIs" )
static

◆ DISPTAG_Version

const JTag JNET::DISPTAG_Version("_Version") ( "_Version" )
static

◆ DISPTAG_Debug

const JTag JNET::DISPTAG_Debug("_Debug") ( "_Debug" )
static

◆ DISPTAG_UNDEFINED

const JTag JNET::DISPTAG_UNDEFINED(0) ( 0 )
static