Code Search for Developers
 
 
  

Runnable.h from AlphaMail at Krugle


Show Runnable.h syntax highlighted

#ifndef RUNNABLE_H
#define RUNNABLE_H

#include <imap_debug.h>

namespace Middleware
{
   class Runnable 
   {
      public:
         virtual ~Runnable() {}
         virtual void operator()() = 0;
   };

   /* This seems silly, but thread copies its target, and its target is usually
    * RequestProcessor, which is not something I want copied.
    */
   template<class T>
   class ThreadDelegate : public Runnable
   {
      boost::shared_ptr<T> target;
      public:
         ThreadDelegate(const boost::shared_ptr<T> &t) : target(t) {}
         ThreadDelegate(const ThreadDelegate& b) {
            this->target = b.target;
         }
         ThreadDelegate &operator=(const ThreadDelegate &b) {
            this->target = b.target;
         }
         void operator()() { (*target)(); }
   };
};

#endif




See more files for this project here

AlphaMail

AlphaMail is an accelerated web mail interface with a C++ middleware layer that is more effective than an IMAP proxy which is a highly scalable (10k+ users). The interface includes modern features, Section 508 compliance, and universal browser support.

Project homepage: http://sourceforge.net/projects/alphamail
Programming language(s): C++,Java,JavaScript,Perl
License: other

  CacheManager.h
  IMAPFolder.h
  IMAPParser.h
  IMAPRegexParser.h
  IMAPTypes.h
  MessageAttributes.h
  RequestProcessor.h
  Runnable.h
  imap_debug.h
  middleware.h