1
// ---------------------------------------------------------------------------
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. -
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
// ---------------------------------------------------------------------------
17
#ifndef AFNIX_LOCOS_HPP
18
#define AFNIX_LOCOS_HPP
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
36
class Locos : public virtual Object {
42
/// create an empty set
45
/// @return the class name
46
String repr (void) const;
49
virtual void reset (void);
51
/// @return the number of rco in the locos
52
virtual long length (void) const;
54
/// @return true if the locos is empty
55
virtual bool empty (void) const;
57
/// @return true if an rco exists in the set
58
virtual bool exists (const Rco& rco) const;
60
/// get the rco index in the locos
61
/// @param rco the rco to find
62
virtual long getidx (const Rco& rco) const;
64
/// add a rco in this locos
65
/// @param rco the rco to add
66
virtual void add (const Rco& rco);
68
/// get a rco by index
69
virtual Rco get (const long index) const;
72
// make the copy constructor private
74
// make the assignment operator private
75
Locos& operator = (const Locos&);
78
/// create a object in a generic way
79
/// @param argv the argument vector
80
static Object* mknew (Vector* argv);
82
/// @return true if the given quark is defined
83
bool isquark (const long quark, const bool hflg) const;
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,