Skip to content
Snippets Groups Projects
Commit 58bc5522 authored by g0dil's avatar g0dil
Browse files

Scheduler: Remove unneeded Socket dependency

Scheduler: Fix documentation (main page)
Socket/Protocols: return ClockService::clock_type from timestamp()
Add 'Scheduler' library dependency to every user of the 'Socket' library
parent d9430f0b
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ import SENFSCons
###########################################################################
SENFSCons.Binary( env, 'ratestuffer', SENFSCons.GlobSources(),
LIBS = [ 'PPI', 'Scheduler', 'Packets', 'Socket', 'Utils' ] );
LIBS = [ 'PPI', 'Scheduler', 'Packets', 'Socket', 'Scheduler', 'Utils' ] );
SENFSCons.Doxygen(env, extra_sources=[
env.Dia2Png('ratestuffer.dia')
......
......@@ -4,7 +4,7 @@ import SENFSCons
###########################################################################
SENFSCons.Binary(env, 'client', 'client.cc',
LIBS = [ 'Packets', 'Socket', 'Utils' ]);
LIBS = [ 'Packets', 'Socket', 'Scheduler', 'Utils' ]);
SENFSCons.Binary(env, 'server', 'server.cc',
LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ]);
LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Scheduler', 'Utils' ]);
......@@ -4,9 +4,9 @@ import SENFSCons
###########################################################################
SENFSCons.Binary(env, 'udpClient', 'udpClient.cc',
LIBS = [ 'Packets', 'Socket', 'Utils' ]);
LIBS = [ 'Packets', 'Socket', 'Scheduler', 'Utils' ]);
SENFSCons.Binary(env, 'udpServer', 'udpServer.cc',
LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Utils' ]);
LIBS = [ 'Scheduler', 'Packets', 'Socket', 'Scheduler', 'Utils' ]);
SENFSCons.Doxygen(env)
......@@ -24,24 +24,20 @@ namespace senf {
/** \mainpage The SENF Scheduler Library
The Scheduler library provides a simple yet flexible abstraction
of the standard asynchronous UNIX mainloop utilizing \c select or
\c poll. The Scheduler library is based on the highly efficient
(but linux specific) \c epoll() system call.
The Scheduler library provides a simple yet flexible abstraction of the standard asynchronous
UNIX mainloop utilizing \c select or \c poll. The Scheduler library is based on the highly
efficient (but linux specific) \c epoll() system call.
The library provides
\li a central \ref Scheduler singleton and
\li \ref ReadHelper and \ref WriteHelper templates to simplify
common tasks.
\li the ClockService as a reliable high-resolution highly accurate monotonous time source
\li a central \ref Scheduler %singleton and
\li \ref ReadHelper and \ref WriteHelper templates to simplify common tasks.
In it's current incarnation, the library only supports network
file handles (including pipes etc) and simple timers (especially
it does not support asynchronous notification for on-disc file
transfers etc). Additional features will be added:
\li UNIX signal support
\li async IO support for local (disc) file handles
\li multi threading support
\li IPC support for multithreaded applications
The Scheduler supports several types of scheduling activites:
\li Arbitrary file descriptors (however, local disk file-handles are not guaranteed
non-blocking)
\li Timers
\li UNIX Signals
*/
}
......
......@@ -10,5 +10,5 @@ SENFSCons.StandardTargets(env)
SENFSCons.Lib(env,
library = 'Scheduler',
sources = sources,
LIBS = [ 'Socket', 'Utils' ])
LIBS = [ 'Utils' ])
SENFSCons.Doxygen(env)
......@@ -13,7 +13,7 @@ sources = SENFSCons.GlobSources()
allob = []
allob.extend(
SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Utils' ] ) )
SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Scheduler', 'Utils' ] ) )
for sc in glob.glob("*/SConscript"):
ob = SConscript(sc)
......
......@@ -35,13 +35,13 @@
#define prefix_
///////////////////////////////cc.p////////////////////////////////////////
prefix_ struct timeval senf::DatagramSocketProtocol::timestamp()
prefix_ senf::ClockService::clock_type senf::DatagramSocketProtocol::timestamp()
const
{
struct timeval tv;
if (::ioctl(fd(), SIOCGSTAMP, &tv) < 0)
SENF_THROW_SYSTEM_EXCEPTION("");
return tv;
return ClockService::from_timeval(tv);
}
///////////////////////////////cc.e////////////////////////////////////////
......
......@@ -29,6 +29,7 @@
// Custom includes
#include <sys/time.h>
#include "../../Socket/SocketProtocol.hh"
#include "../../Scheduler/ClockService.hh"
//#include "DatagramSocketProtocol.mpp"
///////////////////////////////hh.p////////////////////////////////////////
......@@ -44,11 +45,16 @@ namespace senf {
: public virtual SocketProtocol
{
public:
struct timeval timestamp() const; ///< Return packet timestamp of last packet
ClockService::clock_type timestamp() const; ///< Return packet timestamp of last packet
/**< The returned timestamp represents the time, at which
the last network packet passed to the user has been
received from the network. This allows precise network
timing.
The returned value can be converted to the
senf::ClockService::clock_type representation using
semf::ClockService::from_timeval().
\pre The \c SO_TIMESTAMP socket option must not be set
on the socket.
\returns timestamp when last packet was received */
......
......@@ -13,7 +13,7 @@ sources = SENFSCons.GlobSources()
allob = []
allob.extend(
SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Utils' ] ) )
SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Scheduler', 'Utils' ] ) )
for sc in glob.glob("*/SConscript"):
ob = SConscript(sc)
......
......@@ -13,7 +13,7 @@ sources = SENFSCons.GlobSources()
allob = []
allob.extend(
SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Utils' ] ) )
SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Scheduler', 'Utils' ] ) )
for sc in glob.glob("*/SConscript"):
ob = SConscript(sc)
......
......@@ -8,7 +8,7 @@ import SENFSCons, glob
SENFSCons.StandardTargets(env)
sources = SENFSCons.GlobSources()
objects = SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Utils' ] )
objects = SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Scheduler', 'Utils' ] )
for sc in glob.glob("*/SConscript"):
ob = SConscript(sc)
......
......@@ -13,7 +13,7 @@ sources = SENFSCons.GlobSources()
allob = []
allob.extend(
SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Utils' ] ) )
SENFSCons.Objects( env, sources = sources, LIBS = [ 'Socket', 'Scheduler', 'Utils' ] ) )
for sc in glob.glob("*/SConscript"):
ob = SConscript(sc)
......
......@@ -21,7 +21,7 @@ SENFSCons.Lib(env,
library = 'Socket',
sources = sources + subob,
testSources = testSources,
LIBS = [ 'Utils' ])
LIBS = [ 'Scheduler', 'Utils' ])
SENFSCons.Doxygen(env, extra_sources = [
env.Dia2Png('SocketLibrary-classes.dia'),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment