Itasca C++ Interface
Loading...
Searching...
No Matches
imulticontainer.h
1#pragma once
2
3#include "base/src/baseqt.h"
4#include <functional>
5
6namespace itasca {
7 class IThing;
8
10 public:
11 inline static const TType type_ = 0x51cdf4ee;
12
14 IThing *thing_=nullptr;
15 uint thread_=0;
16 uint64 index_=0;
17 uint64 block_=0;
18 };
19 typedef std::function<void(void *,IMultiCallInfo &)> base_func;
20
21 // Returns the IThing pointer of the container.
22 virtual IThing * getIThing()=0;
23 virtual const IThing *getIThing() const=0;
24 virtual IContainer * getIContainer()=0;
25 virtual const IContainer *getIContainer() const=0;
26 virtual uint64 getBlockSize() const=0;
27 virtual void imultiLoopBase(base_func &func,void *v)=0;
28 template <class Data>
29 void imultiLoop(std::function<void(Data *,IMultiCallInfo &)> &func,Data *data);
30 };
31
32 template <class Data>
33 void IMultiContainer::imultiLoop(std::function<void(Data *,IMultiCallInfo &)> &func,Data *data) {
34 base_func out = [&](void *v,IMultiCallInfo &info)->void{ func((Data *)v,info); };
35 imultiLoopBase(out,(void *)data);
36 }
37} // namespace itasca
38
39// EoF
All default base headers if Qt is being used.
Interface for containers of IThings.
Definition icontainer.h:21
Definition imulticontainer.h:9
Base class for items that will be stored in containers.
Definition ithing.h:30
uint32 TType
class type indicator
Definition basedef.h:46
namespace Itasca
Definition basememory.cpp:10
Definition imulticontainer.h:13