Itasca C++ Interface
iblockarray.h
Go to the documentation of this file.
1 #pragma once
2 // iblockaarray.h
3 
10 #include "iblockdef.h"
11 #include "base/src/callback.h"
12 
13 namespace itasca
14 {
15  class IContainer;
16  class IThing;
17 }
18 
19 namespace block
20 {
21  using namespace itasca;
22 
23  class IBlockThing;
24  class BlockThing;
25 
30  {
31  public:
32 
34  virtual const IThing * getIThing() const=0;
36  virtual IThing * getIThing()=0;
38  virtual const IContainer * getIContainer() const=0;
40  virtual IContainer * getIContainer() =0;
42  virtual const IBlockThing * findBlockWithID(quint64 id) const=0;
44  virtual IBlockThing * findBlockWithID(quint64 id)=0;
46  virtual quint32 getBlockType() const=0;
47 
58  virtual int claimBit() const=0;
60  virtual void releaseBit(int bit) const=0;
71  virtual int claimValue() const=0;
73  virtual void releaseValue(int bit) const=0;
75  virtual uint getBlockExtraNotice() const=0;
77  virtual uint getGroupNotice() const=0;
79  virtual uint getGeometryNotice() const=0;
81  virtual uint getJoinNotice() const=0;
83  virtual uint getBoundaryNotice() const=0;
85  virtual uint getMaterialNotice() const=0;
87  virtual uint getHideNotice() const=0;
89  virtual BlockThing * findBlock(const DVect3 &dv, bool visible=false)=0;
93  virtual BlockThing * findBlockContaining(const DVect3 &dv,bool visible)=0;
94 
96  virtual void threadedCallbackObject(
98  void* v = nullptr, bool useThreads = true) const = 0;
99 
101  template <class S, void (S::*MFP)(const IBlockThing*, uint32, uint32, void*)>
102  void threadedCallbackMethod(S* s, void* v = nullptr, bool useThreads = true) const {
104  threadedCallbackObject(callback, v, useThreads);
105  }
106  };
107 
108 } // end namespace block
109 // EOF
Definition: callback.h:37
Definition: callback.h:130
Container to store blockThings. ID of BlockThing is stored in offset $KBID in Fortran block linked li...
Definition: iblockarray.h:30
virtual int claimBit() const =0
Claims a bit from the blocks utility bit field.
virtual const IThing * getIThing() const =0
Returns a const pointer to an IThing interface representing the IBlockArray.
virtual IContainer * getIContainer()=0
Returns a pointer to the IContainer interface representing the global list of blocks.
virtual IThing * getIThing()=0
Returns a pointer to an IThing interface representing the IBlockArray.
virtual uint getHideNotice() const =0
Returns the tag for the block hide state notice.
void threadedCallbackMethod(S *s, void *v=nullptr, bool useThreads=true) const
Implementation of the multithreaded loop using the threadedCallbackObject.
Definition: iblockarray.h:102
virtual uint getGeometryNotice() const =0
Returns the tag for the block geometry change notice.
virtual uint getBlockExtraNotice() const =0
Returns the tag for the block extra variable change notice.
virtual IBlockThing * findBlockWithID(quint64 id)=0
Returns a pointer to the block, IBlock, with the ID id, or 0 if the block does not exist.
virtual void releaseBit(int bit) const =0
Releases a bit index previously obtained with claimBit(). Thread-safe.
virtual const IContainer * getIContainer() const =0
Returns a const pointer to the IContainer interface representing the global list of blocks.
virtual quint32 getBlockType() const =0
Returns the block type identifier.
virtual BlockThing * findBlockContaining(const DVect3 &dv, bool visible)=0
virtual int claimValue() const =0
Claims a bit from the blocks utility value array.
virtual uint getBoundaryNotice() const =0
Returns the tag for the boundary geometry change notice.
virtual uint getGroupNotice() const =0
Returns the tag for the block group change notice.
virtual const IBlockThing * findBlockWithID(quint64 id) const =0
Returns a const pointer to the block, IBlock, with the ID id, or 0 if the block does not exist.
virtual uint getJoinNotice() const =0
Returns the tag for join condition change notice.
virtual void releaseValue(int bit) const =0
Releases a value index back to the zones utility value array. Thread-safe.
virtual uint getMaterialNotice() const =0
Returns the tag for the material change notice.
virtual BlockThing * findBlock(const DVect3 &dv, bool visible=false)=0
Return block closest to input location.
virtual void threadedCallbackObject(Callback4< void, const IBlockThing *, uint32, uint32, void * > &callback, void *v=nullptr, bool useThreads=true) const =0
Object for creation of multithreaded loop over blocks.
This is the interface for BlockThing, a class that holds extra data not in the fortran arrays....
Definition: iblockthing.h:32
Interface for containers of IThings.
Definition: icontainer.h:21
Base class for items that will be stored in containers.
Definition: ithing.h:30
Fortran to C++ type declarations.
namespace Itasca
Definition: basememory.cpp:10