X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FReadHelper.hh;h=011b51a370f95d8ae580741269c8068796baf284;hb=532240d72e09e19e57fac9bb55c2560b9c9e5b97;hp=c4fbbc8fba9fa418e568811ed0bd8f01ce232b36;hpb=98f3f38c5872d26fcf544a9d28efe0518e3895e2;p=senf.git diff --git a/Scheduler/ReadHelper.hh b/Scheduler/ReadHelper.hh index c4fbbc8..011b51a 100644 --- a/Scheduler/ReadHelper.hh +++ b/Scheduler/ReadHelper.hh @@ -21,8 +21,8 @@ /** \file \brief ReadHelper public header */ -#ifndef HH_ReadHelper_ -#define HH_ReadHelper_ 1 +#ifndef HH_SENF_Scheduler_ReadHelper_ +#define HH_SENF_Scheduler_ReadHelper_ 1 // Custom includes #include @@ -30,7 +30,7 @@ #include #include -#include "Utils/intrusive_refcount.hh" +#include "../Utils/intrusive_refcount.hh" #include "Scheduler.hh" //#include "ReadHelper.mpp" @@ -90,7 +90,7 @@ namespace senf { \param[in] handle file descriptor or handle providing the Handle interface defined above. \param[in] maxSize maximum number of bytes to read - \param[in] cb callback + \param[in] callback callback \returns Smart pointer to new ReadHelper instance */ template @@ -106,14 +106,14 @@ namespace senf { the Handle interface defined above. \param[in] maxSize maximum number of bytes to read \param[in] predicate predicate to check - \param[in] cb callback + \param[in] callback callback \returns smart pointer to new ReadHelper instance */ ///@} /////////////////////////////////////////////////////////////////////////// Handle handle() const; ///< Access the handle object - unsigned maxSize() const; ///< Return maximum number of bytes to be read + std::string::size_type maxSize() const; ///< Return maximum number of bytes to be read std::string const & data() const; ///< return data read std::string const & tail() const; ///< return data read but not matched by the predicate @@ -129,13 +129,15 @@ namespace senf { private: struct InternalPredicate; - ReadHelper(Handle handle, unsigned maxSize, InternalPredicate * predicate, Callback cb); + ReadHelper(Handle handle, std::string::size_type maxSize, + InternalPredicate * predicate, Callback cb); - static void dispatchProcess(ptr helper, Handle handle, senf::Scheduler::EventId event); - void process(Handle handle, senf::Scheduler::EventId event); + static void dispatchProcess(ptr helper, Handle handle, int event); + void process(Handle handle, int event); void done(); Handle handle_; + scheduler::FdEvent fde_; std::string::size_type maxSize_; boost::scoped_ptr predicate_; Callback callback_; @@ -177,4 +179,6 @@ namespace senf { // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: