CFEL - ASG Software Suite  2.5.0
CASS
Public Slots | Public Member Functions | Private Attributes | List of all members
jocassview::TCPClient Class Reference

the tcp client that connects to the cass server More...

#include <tcpclient.h>

+ Inheritance diagram for jocassview::TCPClient:
+ Collaboration diagram for jocassview::TCPClient:

Public Slots

void reloadIni () const
 reload .ini file More...
 
void broadcastCommand (const QString &command) const
 broadcast a command to all processors in the server More...
 
void sendCommandTo (const QString &key, const QString &command) const
 broadcast a command to all processors in the server More...
 
void setServer (const QString &serverstring)
 change the server to connect to More...
 
void quitServer () const
 tell the server to quit More...
 
void clearHistogram (QString key) const
 clear the histogram of a processor More...
 

Public Member Functions

 TCPClient ()
 default constructor More...
 
virtual ~TCPClient ()
 destructor More...
 
result_t::shared_pointer result (const QString &key, quint64 id=0)
 retrieve a specific result More...
 
QVector< result_t::shared_pointerresults (const QStringList &list)
 retrieve a list of results all with the same id More...
 
QStringList resultNames ()
 retrieve the list of available histograms More...
 
QString type () const
 return the type of source we are More...
 
size_t receivedBytes () const
 retrieve the transferred bytes More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent=0)
 
 blockSignals (bool block)
 
 childEvent (QChildEvent *event)
 
 children ()
 
 connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type=Qt::AutoConnection)
 
 connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type=Qt::AutoConnection)
 
 connectNotify (const char *signal)
 
 customEvent (QEvent *event)
 
 deleteLater ()
 
 destroyed (QObject *obj=0)
 
 disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
 disconnect (const char *signal=0, const QObject *receiver=0, const char *method=0)
 
 disconnect (const QObject *receiver, const char *method=0)
 
 disconnectNotify (const char *signal)
 
 dumpObjectInfo ()
 
 dumpObjectTree ()
 
 dynamicPropertyNames ()
 
 event (QEvent *e)
 
 eventFilter (QObject *watched, QEvent *event)
 
 findChild (const QString &name=QString()
 
 findChildren (const QString &name=QString()
 
 findChildren (const QRegExp &regExp)
 
 inherits (const char *className)
 
 installEventFilter (QObject *filterObj)
 
 isWidgetType ()
 
 killTimer (int id)
 
 metaObject ()
 
 moveToThread (QThread *targetThread)
 
 parent ()
 
 property (const char *name)
 
 receivers (const char *signal)
 
 removeEventFilter (QObject *obj)
 
 sender ()
 
 setParent (QObject *parent)
 
 setProperty (const char *name, const QVariant &value)
 
 signalsBlocked ()
 
 startTimer (int interval)
 
 thread ()
 
 timerEvent (QTimerEvent *event)
 
 tr (const char *sourceText, const char *disambiguation=0, int n=-1)
 
 trUtf8 (const char *sourceText, const char *disambiguation=0, int n=-1)
 
 staticMetaObject
 

Private Attributes

size_t _transferredBytes
 the amount of bytes transferred More...
 
std::string _server
 the server string More...
 

Additional Inherited Members

- Public Types inherited from jocassview::DataSource
typedef cass::Result< float > result_t
 define the result type More...
 

Detailed Description

the tcp client that connects to the cass server

Author
Lutz Foucar

Definition at line 34 of file jocassview/tcpclient.h.

Constructor & Destructor Documentation

TCPClient::TCPClient ( )

default constructor

Definition at line 32 of file jocassview/tcpclient.cpp.

TCPClient::~TCPClient ( )
virtual

destructor

Definition at line 37 of file jocassview/tcpclient.cpp.

Member Function Documentation

void TCPClient::broadcastCommand ( const QString command) const
slot

broadcast a command to all processors in the server

Parameters
commandThe command to broadcast

Definition at line 167 of file jocassview/tcpclient.cpp.

References _server, QMessageBox::information(), QFuture::isRunning(), QCoreApplication::processEvents(), and QObject::tr().

void TCPClient::clearHistogram ( QString  key) const
slot

clear the histogram of a processor

Parameters
keyThe key of the Postprocessor whos histograms should be cleared

Definition at line 227 of file jocassview/tcpclient.cpp.

References _server, QMessageBox::information(), QFuture::isRunning(), QCoreApplication::processEvents(), and QObject::tr().

void TCPClient::quitServer ( ) const
slot
size_t TCPClient::receivedBytes ( ) const

retrieve the transferred bytes

Definition at line 145 of file jocassview/tcpclient.cpp.

References _transferredBytes.

void TCPClient::reloadIni ( ) const
slot
DataSource::result_t::shared_pointer TCPClient::result ( const QString key,
quint64  id = 0 
)
virtual

retrieve a specific result

Returns
Histogram for requested key
Parameters
keythe key of the requested result
idthe event id of the histogram to be returned

Implements jocassview::DataSource.

Definition at line 41 of file jocassview/tcpclient.cpp.

References _server, _transferredBytes, QFuture::isRunning(), QCoreApplication::processEvents(), and QFuture::result().

Referenced by results().

QStringList TCPClient::resultNames ( )
virtual

retrieve the list of available histograms

Returns
the list of names of available histograms

Implements jocassview::DataSource.

Definition at line 101 of file jocassview/tcpclient.cpp.

References _server, _transferredBytes, QString::fromStdString(), jocassview::IdList::getList(), QMessageBox::information(), QFuture::isRunning(), QCoreApplication::processEvents(), QFuture::result(), and QObject::tr().

QVector< DataSource::result_t::shared_pointer > TCPClient::results ( const QStringList list)

retrieve a list of results all with the same id

Returns
list of shared pointers of the requested results
Parameters
listthe list of keys who's histograms should be retrieved

set up the client

serialize the id list

add the serialized list to the dime attachment and sent the request

create the container for the results

when the communication failed return here

create a deserializing object and retrieve all results from it

Definition at line 66 of file jocassview/tcpclient.cpp.

References _server, cass::Serializer::buffer(), data, QVector::push_back(), result(), jocassview::IdList::serialize(), and status.

void TCPClient::sendCommandTo ( const QString key,
const QString command 
) const
slot

broadcast a command to all processors in the server

Parameters
keyThe key of the Postprocessor to send the command to
commandThe command to broadcast

Definition at line 185 of file jocassview/tcpclient.cpp.

References _server, QMessageBox::information(), QFuture::isRunning(), QCoreApplication::processEvents(), and QObject::tr().

void TCPClient::setServer ( const QString serverstring)
slot

change the server to connect to

Parameters
serverstringthe server name and port as string

Definition at line 205 of file jocassview/tcpclient.cpp.

References _server.

QString TCPClient::type ( ) const
virtual

return the type of source we are

Returns
"TCPClient"

Implements jocassview::DataSource.

Definition at line 140 of file jocassview/tcpclient.cpp.

Member Data Documentation

std::string jocassview::TCPClient::_server
private

the server string

Note
this is needed because the client only hold a pointer to the string and not the string itself.

Definition at line 116 of file jocassview/tcpclient.h.

Referenced by broadcastCommand(), clearHistogram(), quitServer(), reloadIni(), result(), resultNames(), results(), sendCommandTo(), and setServer().

size_t jocassview::TCPClient::_transferredBytes
mutableprivate

the amount of bytes transferred

Definition at line 109 of file jocassview/tcpclient.h.

Referenced by receivedBytes(), result(), and resultNames().


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