8#include "base/src/spinlock.h"
39 class Lock :
public std::lock_guard<LockType> {
41 inline Lock(
const IThing *t) : std::lock_guard<LockType>(t->thingLock_) { }
56 explicit Handle(uint64 h) : val_(h) { }
57 bool operator<(
const Handle &h)
const {
return val_<h.val_; }
58 bool operator==(
const Handle &h)
const {
return val_==h.val_; }
59 bool valid()
const {
return val_ ? true :
false; }
110 virtual void setID(uint64)=0;
174 virtual uint64 getContainerOrder()
const=0;
199 virtual void getGroupInfo(std::vector<std::pair<int,string>> *)
const = 0;
204 virtual void clearGroup()=0;
212 virtual void clearExtra()=0;
225 virtual void save(Archive2 &)
const=0;
226 virtual bool restore(Archive2 &,uint64)=0;
227 virtual void remap(Archive2 &)=0;
228 virtual Handle getRemapHandle(
bool allowCreate,uint32 thread)
const=0;
245 template <
class Dest,
class Src>
inline const Dest*
convert_getcast(
const Src* src) {
return src ? src->getIThing()->template convert<Dest>() : 0; }
247 template <
class Dest,
class Src>
inline Dest*
convert_getcast(Src* src) {
return src ? src->getIThing()->template convert<Dest>() : 0; }
249 inline int64 pointCompare(
const IThing *p1,
const IThing *p2) {
250 int64 i1 = p1 ? p1->getType() : 0;
251 int64 i2 = p2 ? p2->getType() : 0;
253 i1 = p1 ? p1->getID() : 0;
254 i2 = p2 ? p2->getID() : 0;
An array class that attempts to minimize unnecessary heap access.
Definition farray.h:25
Class for storing an "orientation", or a direction in 2D or 3D space.
Definition orientation.h:99
Definition iparameter.h:19
Interface for containers of IThings.
Definition icontainer.h:21
Interface to a group object.
Definition igroup.h:9
Base class for items that will be stored in containers.
Definition ithing.h:31
virtual DVect3 getLocation() const =0
virtual bool getIsSet() const =0
virtual DVect3 getClosest(const DVect3 &pos) const =0
virtual DVect3 getVelocityThing() const =0
Returns the instantaneous velocity for things supporting velocity.
virtual void setExtra(uint32 index, const fish::IParameter &p)=0
virtual bool setSelected(bool b)=0
Sets the selected flag at index.
virtual DVect3 getDisplacementThing() const =0
Returns the accumulated displacement for things supporting displacement.
virtual void getAssociatedThings(const TType &type, FArray< const IThing * > *ret) const =0
Returns a list of things associated with this thing with TType type.
virtual bool addGroup(const IGroupID &id)=0
static const TType type_
The base type of an IThing.
Definition ithing.h:64
virtual DVect3 getNormal() const =0
Returns a normal vector representing the orientation of the object, if this is appropriate....
virtual bool isOnSurface() const =0
Returns TRUE if this is a "Surface".
virtual void resetAssociatedThings(FArray< const IThing * > *ret)=0
Resets any data used with the associated things.
virtual bool getHidden() const =0
Returns the Hide flag at index.
virtual uint32 isInGroup(const FArray< IGroupID > &ids, TType type=0, bool only=false) const =0
static const uint32 maxExtraIndex_
Maximum number of extra FISH variables per object.
Definition ithing.h:68
virtual IThing * getIThing()=0
Return the IThing interface.
virtual DExtent3 getExtent() const =0
virtual void getGroupInfo(std::vector< std::pair< int, string > > *) const =0
Returns the group name/slot for all groups.
virtual TType getGeneralType() const =0
virtual const IThing * getIThing() const =0
Return the IThing interface.
virtual std::vector< uint32 > getExtraIndices() const =0
Returns the number of extra FISH extra variables for this object.
virtual bool isWithinOrientation(const Orientation3 &orientation, const DVect2 &tol) const =0
virtual uint64 getID() const =0
Returns a value - the exact meaning of which is defined by the container and the implementing class.
T * convert()
Definition ithing.h:106
virtual string getTypeName() const =0
Returns a description of the type of the class.
const T * convert() const
Definition ithing.h:105
virtual IContainer * getContainer()=0
virtual const IGroup * getGroup(const ISlotID &slot) const =0
virtual void * convertToTypeNC(const TType &id)=0
virtual bool getSelected() const =0
Returns the selected flag at index.
virtual string getGroupName(const ISlotID &slot=ISlotID()) const =0
virtual double getVolume() const =0
Returns the volume if this is appropraite. 0 is returned otherwise.
virtual const IContainer * getContainer() const =0
virtual bool removeGroup(const IGroupID &id)=0
virtual TType getType() const =0
static const uint32 maxGroupSlot_
Maximum number of group slots per object.
Definition ithing.h:66
virtual const fish::IParameter * getExtra(uint32 index) const =0
virtual const IThing * getSet() const =0
virtual uint32 getGroupList(FArray< IGroupID > *list) const =0
Return all groups and all slots assigned to the object in a list.
virtual const void * convertToType(const TType &id) const =0
virtual void save(Archive2 &) const =0
Archives the Thing to a file (if appropriate).
virtual uint64 getCollectionID() const =0
virtual bool setHidden(bool b)=0
Sets the hidden flag at index.
virtual void copyGroups(const IThing *t)=0
Copies group data from one IThing to this, all original group data is lost.
virtual string getName() const =0
Returns a name string - the exact meaning of which is defined by the container and the implementing c...
An array class that attempts to minimize unnecessary heap access.
uint32 TType
class type indicator
Definition basedef.h:47
namespace Itasca
Definition basememory.cpp:14
const Dest * convert_cast(const IThing *src)
A cast operator (use similar to dynamic_cast) for types derived from IThing (const).
Definition ithing.h:240
const Dest * convert_getcast(const Src *src)
A cast operator for Interface types that define getThing() (const).
Definition ithing.h:245
namespace itasca
Definition igenerictet.h:11