+// $Id$
+//
// Copyright (C) 2007
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
+// Fraunhofer Institute for Open Communication Systems (FOKUS)
+// Competence Center NETwork research (NET), St. Augustin, GERMANY
// Stefan Bund <g0dil@berlios.de>
//
// This program is free software; you can redistribute it and/or modify
This read helper will read a datagram from a datagram socket. This datagram will then be
interpreted as a packet of type \a Packet as defined in the packet library. \a Packet
- defaults to \ref DataPacket, which will place the data uninterpreted into a packet data
- structure.
+ defaults to DataPacket (type DataPacketType), which will place the data uninterpreted
+ into a packet data structure.
*/
template <class Packet=DataPacket>
class PacketSource
class SomeSource
{
public:
- typedef unspecified_type Handle; // type of handle requested
- SomeSource(); // default constructible
- Packet operator()(Handle handle); // extraction function
+ typedef unspecified_type Handle; // type of handle requested
+
+ SomeSource(); // EITHER default constructible
+ SomeSource(SomeSource const & other); // OR copy constructible
+
+ Packet operator()(Handle handle); // extraction function
};
\endcode
Whenever the FileHandle object is ready for reading, the \a Source's \c operator() is called
ActiveSocketSource(Handle handle); ///< Create new reader for the given handle
/**< Data will be read from \a handle and be parsed by \a
Source.
+ \pre Requires \a Source to be default constructible
\param[in] handle Handle to read data from */
+ ActiveSocketSource(Handle handle, Source source);
+ ///< Create new reader for the given handle
+ /**< Data will be read from \a handle and be parsed by \a
+ Source.
+ \pre Requires \a Source to be copy constructible
+ \param[in] handle Handle to read data from */
+
+ Source & source(); ///< Access source helper
private:
void read();
///////////////////////////////hh.e////////////////////////////////////////
//#include "SocketSource.cci"
#include "SocketSource.ct"
-//#include "SocketSource.cti"
+#include "SocketSource.cti"
#endif
\f