2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2014-2014 - Scilab Enterprises - Clement DAVID
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
13 #ifndef BASEOBJECT_HXX_
14 #define BASEOBJECT_HXX_
18 #include "utilities.hxx"
20 namespace org_scilab_modules_scicos
28 BaseObject(kind_t k) :
32 BaseObject(const BaseObject& b) :
33 _id(0), _kind(b._kind)
37 inline bool operator<(BaseObject o)
41 inline bool operator==(BaseObject o)
50 inline void id(ScicosID id)
62 * An id is used as a reference to the current object
72 /** @defgroup utilities Shared utility classes
77 * Represent a graphical object
86 Geometry() : x(0), y(0), width(20), height(20) {};
87 Geometry(const Geometry& g) : x(g.x), y(g.y), width(g.width), height(g.height) {};
88 Geometry(const std::vector<double>& v) : x(v[0]), y(v[1]), width(v[2]), height(v[3]) {};
90 void fill(std::vector<double>& v) const
98 bool operator==(const Geometry& g) const
100 return x == g.x && y == g.y && width == g.width && height == g.height;
105 * Per port type descriptor
107 * FIXME: should reuse Scilab datatypes descriptors
112 Datatype(const std::vector<int>& v) :
113 refCount(0), datatype_id(v[2]), rows(v[0]), columns(v[1])
117 // reference counter for the flyweight pattern
120 const int datatype_id;
124 bool operator==(const Datatype& d) const
126 return datatype_id == d.datatype_id && rows == d.rows && columns == d.columns;
129 bool operator<(const Datatype& d) const
131 return datatype_id < d.datatype_id && rows < d.rows && columns < d.columns;
137 } /* namespace model */
138 } /* namespace org_scilab_modules_scicos */
140 #endif /* BASEOBJECT_HXX_ */