OpendTect  6.6
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
DataPackMgr Class Reference

Manages DataPacks. More...

Inheritance diagram for DataPackMgr:
[legend]

Public Types

typedef int ID
 Each Mgr has its own ID. More...
 

Public Member Functions

 DataPackMgr (ID)
 
 ~DataPackMgr ()
 
void add (DataPack *)
 The pack becomes mine. More...
 
DataPackaddAndObtain (DataPack *)
 
const char * categoryOf (DataPack::ID) const
 
void dumpInfo (od_ostream &) const
 
virtual void dumpInfoFor (DataPack::ID, IOPar &) const
 
bool haveID (const DataPack::FullID &fid) const
 
bool haveID (DataPack::ID) const
 
ID id () const
 
const char * nameOf (DataPack::ID) const
 
float nrKBytes () const
 
virtual float nrKBytesOf (DataPack::ID) const
 
DataPackobserve (DataPack::ID dpid)
 
const DataPackobserve (DataPack::ID dpid) const
 
DataPackobtain (DataPack::ID dpid)
 
const DataPackobtain (DataPack::ID dpid) const
 
const ObjectSet< const DataPack > & packs () const
 
void release (const DataPack *dp)
 
void release (DataPack::ID)
 
void releaseAll (bool donotify)
 
- Public Member Functions inherited from CallBacker
 CallBacker ()
 
 CallBacker (const CallBacker &)
 
virtual ~CallBacker ()
 
bool attachCB (const NotifierAccess &, const CallBack &, bool onlyifnew=false) const
 
bool attachCB (const NotifierAccess *notif, const CallBack &cb, bool onlyifnew=false) const
 
void detachAllNotifiers () const
 Call from the destructor of your inherited object. More...
 
void detachCB (const NotifierAccess &, const CallBack &) const
 
void detachCB (const NotifierAccess *notif, const CallBack &cb) const
 
virtual bool isCapsule () const
 
bool isNotifierAttached (const NotifierAccess *) const
 Only for debugging purposes, don't use. More...
 
void stopReceivingNotifications () const
 

Static Public Member Functions

static ID BufID ()
 Simple data buffer: 1. More...
 
static const char * categoryOf (const DataPack::FullID &)
 
static DataPackMgrDPM (ID)
 
static void dumpDPMs (od_ostream &)
 
static ID FlatID ()
 Flat (N1xN2) data: 4. More...
 
static ID getID (const DataPack::FullID &fid)
 
static DataPackMgrgtDPM (ID, bool)
 
static const char * nameOf (const DataPack::FullID &)
 
static ID PointID ()
 Sets of 'unconnected' points: 2. More...
 
static ID SeisID ()
 Cube/Block (N1xN2xN3) data: 3. More...
 
static ID SurfID ()
 Surface (triangulated) data: 5. More...
 
- Static Public Member Functions inherited from CallBacker
static void createReceiverForCurrentThread ()
 
static void removeReceiverForCurrentThread ()
 

Public Attributes

Notifier< DataPackMgrnewPack
 Passed CallBacker* = Pack. More...
 
Notifier< DataPackMgrpackToBeRemoved
 Passed CallBacker* = Pack. More...
 

Protected Member Functions

DataPackdoObtain (ID, bool) const
 
int indexOf (ID) const
 Object should be readlocked. More...
 

Protected Attributes

ID id_
 
ObjectSet< const DataPackpacks_
 
Threads::Lock rwlock_
 

Static Protected Attributes

static Threads::Lock mgrlistlock_
 
static ManagedObjectSet< DataPackMgrmgrs_
 

Detailed Description

Manages DataPacks.

DataPacks will be managed with everything in it. If you add a Pack, you will get the ID of the pack.

When you obtain the data for looking at it, you can choose to 'only observe'. In that case, you'd better use the packToBeRemoved notifier, as the data may be deleted at any time. Normally, you want to obtain a reference whilst making sure the data is not thrown away.

This means you must release the data pack once you no longer use it, but NEVER* release a pack when you used the 'observing_only' option.

You can get an appropriate DataPackMgr from the DPM() function.

<>

Member Typedef Documentation

◆ ID

typedef int DataPackMgr::ID

Each Mgr has its own ID.

Constructor & Destructor Documentation

◆ DataPackMgr()

DataPackMgr::DataPackMgr ( ID  )

You can, but normally should not, construct a manager. In general, leave it to DPM().

◆ ~DataPackMgr()

DataPackMgr::~DataPackMgr ( )

Delete a DataPackMgr only when you have created it with the constructor.

Member Function Documentation

◆ add()

void DataPackMgr::add ( DataPack )

The pack becomes mine.

◆ addAndObtain()

DataPack* DataPackMgr::addAndObtain ( DataPack )

The pack becomes mines. Pack is obtained during the lock, i.e. threadsafe.

◆ BufID()

static ID DataPackMgr::BufID ( )
static

Simple data buffer: 1.

◆ categoryOf() [1/2]

static const char* DataPackMgr::categoryOf ( const DataPack::FullID )
static

◆ categoryOf() [2/2]

const char* DataPackMgr::categoryOf ( DataPack::ID  ) const

◆ doObtain()

DataPack* DataPackMgr::doObtain ( ID  ,
bool   
) const
protected

◆ DPM()

static DataPackMgr& DataPackMgr::DPM ( ID  )
static

◆ dumpDPMs()

static void DataPackMgr::dumpDPMs ( od_ostream )
static

◆ dumpInfo()

void DataPackMgr::dumpInfo ( od_ostream ) const

◆ dumpInfoFor()

virtual void DataPackMgr::dumpInfoFor ( DataPack::ID  ,
IOPar  
) const
virtual

◆ FlatID()

static ID DataPackMgr::FlatID ( )
static

Flat (N1xN2) data: 4.

◆ getID()

static ID DataPackMgr::getID ( const DataPack::FullID fid)
inlinestatic

◆ gtDPM()

static DataPackMgr* DataPackMgr::gtDPM ( ID  ,
bool   
)
static

◆ haveID() [1/2]

bool DataPackMgr::haveID ( const DataPack::FullID fid) const
inline

◆ haveID() [2/2]

bool DataPackMgr::haveID ( DataPack::ID  ) const

◆ id()

ID DataPackMgr::id ( ) const
inline

◆ indexOf()

int DataPackMgr::indexOf ( ID  ) const
protected

Object should be readlocked.

◆ nameOf() [1/2]

static const char* DataPackMgr::nameOf ( const DataPack::FullID )
static

◆ nameOf() [2/2]

const char* DataPackMgr::nameOf ( DataPack::ID  ) const

◆ nrKBytes()

float DataPackMgr::nrKBytes ( ) const

◆ nrKBytesOf()

virtual float DataPackMgr::nrKBytesOf ( DataPack::ID  ) const
virtual

◆ observe() [1/2]

DataPack* DataPackMgr::observe ( DataPack::ID  dpid)
inline

◆ observe() [2/2]

const DataPack* DataPackMgr::observe ( DataPack::ID  dpid) const
inline

◆ obtain() [1/2]

DataPack* DataPackMgr::obtain ( DataPack::ID  dpid)
inline

◆ obtain() [2/2]

const DataPack* DataPackMgr::obtain ( DataPack::ID  dpid) const
inline

◆ packs()

const ObjectSet<const DataPack>& DataPackMgr::packs ( ) const
inline

◆ PointID()

static ID DataPackMgr::PointID ( )
static

Sets of 'unconnected' points: 2.

◆ release() [1/2]

void DataPackMgr::release ( const DataPack dp)
inline

◆ release() [2/2]

void DataPackMgr::release ( DataPack::ID  )

◆ releaseAll()

void DataPackMgr::releaseAll ( bool  donotify)

◆ SeisID()

static ID DataPackMgr::SeisID ( )
static

Cube/Block (N1xN2xN3) data: 3.

◆ SurfID()

static ID DataPackMgr::SurfID ( )
static

Surface (triangulated) data: 5.

Member Data Documentation

◆ id_

ID DataPackMgr::id_
protected

◆ mgrlistlock_

Threads::Lock DataPackMgr::mgrlistlock_
staticprotected

◆ mgrs_

ManagedObjectSet<DataPackMgr> DataPackMgr::mgrs_
staticprotected

◆ newPack

Notifier<DataPackMgr> DataPackMgr::newPack

Passed CallBacker* = Pack.

◆ packs_

ObjectSet<const DataPack> DataPackMgr::packs_
protected

◆ packToBeRemoved

Notifier<DataPackMgr> DataPackMgr::packToBeRemoved

Passed CallBacker* = Pack.

◆ rwlock_

Threads::Lock DataPackMgr::rwlock_
mutableprotected

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B.V. 1995-2022