~ubuntu-branches/ubuntu/wily/afnix/wily

« back to all changes in this revision

Viewing changes to src/mod/csm/shl/Slot.hpp

  • Committer: Package Import Robot
  • Author(s): Nobuhiro Iwamatsu
  • Date: 2015-07-11 02:00:35 UTC
  • mfrom: (10.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20150711020035-2nhpztq7s15qyc0v
Tags: 2.5.1-1
* New upstream release. (Closes: #789968)
* Update debian/control.
  - Update Standards-Version to 3.9.6.
* Add support mips64(el) and ppc64el. (Closes: #741508, #748146)
* Add patches/support-gcc-5.x.patch. (Closes: #777767)
  - Fix build with gcc-5.x.
* Add patches/Disable-NET0001.als.patch.
  - Disable test of NET0001.als.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// ---------------------------------------------------------------------------
2
 
// - Slot.hpp                                                                -
3
 
// - afnix:csm module - slot class definition                                -
4
 
// ---------------------------------------------------------------------------
5
 
// - This program is free software;  you can redistribute it  and/or  modify -
6
 
// - it provided that this copyright notice is kept intact.                  -
7
 
// -                                                                         -
8
 
// - This program  is  distributed in  the hope  that it will be useful, but -
9
 
// - without  any  warranty;  without  even   the   implied    warranty   of -
10
 
// - merchantability or fitness for a particular purpose.  In no event shall -
11
 
// - the copyright holder be liable for any  direct, indirect, incidental or -
12
 
// - special damages arising in any way out of the use of this software.     -
13
 
// ---------------------------------------------------------------------------
14
 
// - copyright (c) 1999-2012 amaury darsch                                   -
15
 
// ---------------------------------------------------------------------------
16
 
 
17
 
#ifndef  AFNIX_SLOT_HPP
18
 
#define  AFNIX_SLOT_HPP
19
 
 
20
 
#ifndef  AFNIX_STRING_HPP
21
 
#include "String.hpp"
22
 
#endif
23
 
 
24
 
namespace afnix {
25
 
 
26
 
  /// The Slot class is a base class design to handle a basic time slot
27
 
  /// event. The class is defined with a date and a duration. Various class
28
 
  /// can be derived from it such like the appointment. The slot class
29
 
  /// is primarily used to build an agenda.
30
 
  /// @author amaury darsch
31
 
 
32
 
  class Slot : public virtual Object {
33
 
  protected:
34
 
    /// the slot time
35
 
    t_long d_time;
36
 
    /// the duration time
37
 
    t_long d_dlen;
38
 
    /// the slot index
39
 
    long   d_sidx;
40
 
 
41
 
  public:
42
 
    /// create a default slot
43
 
    Slot (void);
44
 
 
45
 
    /// create a slot by time and duration
46
 
    /// @param time the slot time
47
 
    /// @param dlen the duration time
48
 
    Slot (const t_long time, const t_long dlen);
49
 
 
50
 
    /// copy construct this slot
51
 
    /// @param that the slot to copy
52
 
    Slot (const Slot& that);
53
 
 
54
 
    /// @return the class name
55
 
    String repr (void) const;
56
 
 
57
 
    /// assign a slot to this one
58
 
    /// @param that the slot to assign
59
 
    Slot& operator = (const Slot& that);
60
 
 
61
 
    /// reset this slot
62
 
    virtual void reset (void);
63
 
 
64
 
    /// set the slot time
65
 
    /// @param time the slot time to set
66
 
    virtual void settime (const t_long time);
67
 
 
68
 
    /// @return the slot time
69
 
    virtual t_long gettime (void) const;
70
 
 
71
 
    /// set the slot duration
72
 
    /// @param dlen the duration time to set
73
 
    virtual void setdlen (const t_long dlen);
74
 
 
75
 
    /// @return the slot duration
76
 
    virtual t_long getdlen (void) const;
77
 
 
78
 
    /// set the slot at once
79
 
    /// @param time the slot time to set
80
 
    /// @param dlen the duration time to set
81
 
    virtual void setslot (const t_long time, const t_long dlen);
82
 
 
83
 
    /// set the slot index
84
 
    /// @param sidx the slot index to set
85
 
    virtual void setsidx (const long sidx);
86
 
 
87
 
    /// @return the slot index
88
 
    virtual long getsidx (void) const;
89
 
 
90
 
    /// @return true if the slot matches in time and duration
91
 
    /// @param slot the slot to match
92
 
    virtual bool match (const Slot& slot) const;
93
 
 
94
 
  public:
95
 
    /// create a object in a generic way
96
 
    /// @param argv the argument vector
97
 
    static Object* mknew (Vector* argv);
98
 
 
99
 
    /// @return true if the given quark is defined
100
 
    bool isquark (const long quark, const bool hflg) const;
101
 
 
102
 
    /// apply this object with a set of arguments and a quark
103
 
    /// @param robj  the current runnable
104
 
    /// @param nset  the current nameset    
105
 
    /// @param quark the quark to apply these arguments
106
 
    /// @param argv  the arguments to apply
107
 
    Object* apply (Runnable* robj, Nameset* nset, const long quark,
108
 
                   Vector* argv);
109
 
  };
110
 
}
111
 
 
112
 
#endif