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

« back to all changes in this revision

Viewing changes to src/mod/csm/shl/Locos.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
 
// - Locos.hpp                                                               -
3
 
// - afnix:csm module - local cloud object set 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_LOCOS_HPP
18
 
#define  AFNIX_LOCOS_HPP
19
 
 
20
 
#ifndef  AFNIX_SET_HPP
21
 
#include "Set.hpp"
22
 
#endif
23
 
 
24
 
#ifndef  AFNIX_RCO_HPP
25
 
#include "Rco.hpp"
26
 
#endif
27
 
 
28
 
namespace afnix {
29
 
 
30
 
  /// The Locos class is the local cloud object set. The class is designed
31
 
  /// to store registered cloud object (rco). The implementation is primarily
32
 
  /// designed to store a unique form of objects and provides the necessary
33
 
  /// mechanism to retrieve an object by registration id.
34
 
  /// @author amaury darsch
35
 
 
36
 
  class Locos : public virtual Object {
37
 
  protected:
38
 
    /// the object set
39
 
    Set d_cos;
40
 
 
41
 
  public:
42
 
    /// create an empty set
43
 
    Locos (void);
44
 
 
45
 
    /// @return the class name
46
 
    String repr (void) const;
47
 
 
48
 
    /// reset this locos
49
 
    virtual void reset (void);
50
 
 
51
 
    /// @return the number of rco in the locos
52
 
    virtual long length (void) const;
53
 
 
54
 
    /// @return true if the locos is empty
55
 
    virtual bool empty (void) const;
56
 
 
57
 
    /// @return true if an rco exists in the set
58
 
    virtual bool exists (const Rco& rco) const;
59
 
 
60
 
    /// get the rco index in the locos
61
 
    /// @param rco the rco to find
62
 
    virtual long getidx (const Rco& rco) const;
63
 
 
64
 
    /// add a rco in this locos
65
 
    /// @param rco the rco to add
66
 
    virtual void add (const Rco& rco);
67
 
 
68
 
    /// get a rco by index
69
 
    virtual Rco get (const long index) const;
70
 
 
71
 
  private:
72
 
    // make the copy constructor private
73
 
    Locos (const Locos&);
74
 
    // make the assignment operator private
75
 
    Locos& operator = (const Locos&);
76
 
 
77
 
  public:
78
 
    /// create a object in a generic way
79
 
    /// @param argv the argument vector
80
 
    static Object* mknew (Vector* argv);
81
 
 
82
 
    /// @return true if the given quark is defined
83
 
    bool isquark (const long quark, const bool hflg) const;
84
 
 
85
 
    /// apply this object with a set of arguments and a quark
86
 
    /// @param robj  the current runnable
87
 
    /// @param nset  the current nameset    
88
 
    /// @param quark the quark to apply these arguments
89
 
    /// @param argv  the arguments to apply
90
 
    Object* apply (Runnable* robj, Nameset* nset, const long quark,
91
 
                   Vector* argv);
92
 
  };
93
 
}
94
 
 
95
 
#endif