File: Dispatcher_Impl.h

package info (click to toggle)
ace 6.4.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 48,640 kB
  • ctags: 41,204
  • sloc: cpp: 336,448; perl: 33,068; ansic: 20,676; sh: 3,735; exp: 787; python: 635; yacc: 511; xml: 330; lex: 158; lisp: 116; makefile: 80; csh: 20; tcl: 5
file content (72 lines) | stat: -rw-r--r-- 1,810 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/* -*- C++ -*- */
/**
 *  @file   Dispatcher_Impl.h
 *
 *  @author Venkita Subramonian (venkita@cs.wustl.edu)
 *
 * Based on previous work by Tim Harrison (harrison@cs.wustl.edu),
 * Chris Gill, Carlos O'Ryan and other members of the DOC group.
 */

#ifndef DISPATCHER_IMPL_H
#define DISPATCHER_IMPL_H
#include /**/ "ace/pre.h"

#include "Kokyu_defs.h"

#if !defined (ACE_LACKS_PRAGMA_ONCE)
# pragma once
#endif /* ACE_LACKS_PRAGMA_ONCE */

#include "kokyu_export.h"

namespace Kokyu
{
  /**
   * @class Dispatcher
   *
   * @brief Base class for EC dispatcher implementations
   *
   * The responsibility of this class is to act as a common base class
   * for different EC dispatcher implementations. This is an
   * abstract base class and cannot be instantiated.
   */
  class Kokyu_Export Dispatcher_Impl
  {
  public:
    /// Configure the dispatcher.
    int init (const Dispatcher_Attributes&);

    int activate ();

    /// dispatch a command (eg. event) based on the QoS supplied.
    int dispatch (const Dispatch_Command*,
                  const QoSDescriptor&);

    /// shutdown the dispatcher.
    int shutdown ();

    virtual ~Dispatcher_Impl();

  private:
    //following an idiom to avoid public virtual functions.
    //instead make them private and use the template method
    //pattern - "Virtually Yours" article in CUJ Experts Forum

    virtual int init_i (const Dispatcher_Attributes&) =0;
    virtual int dispatch_i (const Dispatch_Command*,
                            const QoSDescriptor&) =0;
    virtual int shutdown_i () =0;
    virtual int activate_i () =0;

  protected:
    int thr_creation_flags_;
  };
} //end of namespace

#if defined (__ACE_INLINE__)
#include "Dispatcher_Impl.inl"
#endif /* __ACE_INLINE__ */

#include /**/ "ace/post.h"
#endif /* DISPATCHER_IMPL_H */