OpendTect  6.3
cbvsio.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: A.H.Bril
8  Date: 12-3-2001
9  Contents: Common Binary Volume Storage format io
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "generalmod.h"
15 #include "position.h"
16 #include "posinfo.h"
17 #include "bufstringset.h"
18 #include "uistrings.h"
19 
20 
28 mExpClass(General) CBVSIO
29 {
30 public:
31 
33  : errmsg_(toUiString("")),
34  strmclosed_(false), nrxlines_(1),
35  nrcomps_(0), cnrbytes_(0) {}
36  virtual ~CBVSIO();
37 
38  bool failed() const { return !errmsg_.isEmpty(); }
39  const uiString errMsg() const { return errmsg_; }
40 
41  virtual void close() = 0;
42  int nrComponents() const { return nrcomps_; }
43  const BinID& binID() const { return curbinid_; }
44  void setErrMsg( const uiString s ) { errmsg_ = s; }
45 
46  static const int integersize;
47  static const int version;
48  static const int headstartbytes;
49 
50  enum CoordPol { InAux=0, InTrailer=1, NotStored=2 };
51 
52 protected:
53 
55  int* cnrbytes_;
56  int nrcomps_;
58  int nrxlines_;
62 
63  mutable BinID curbinid_;
64 
65 };
66 
67 
74 public:
75 
76  CBVSIOMgr( const char* basefname )
77  : curnr_(0)
78  , basefname_(basefname) {}
79  virtual ~CBVSIOMgr();
80 
81  inline bool failed() const { return !errMsg().isEmpty(); }
82  inline const uiString errMsg() const { return errmsg_;}
83 
84  virtual void close() = 0;
85 
86  virtual int nrComponents() const = 0;
87  virtual const BinID& binID() const = 0;
88 
89  inline BufferString getFileName( int nr ) const
90  { return getFileName(basefname_,nr); }
91 
92  static BufferString baseFileName(const char*);
93  static BufferString getFileName(const char*,int);
95  static int getFileNr(const char*);
97 
98 protected:
99 
103  int curnr_;
104 
105  virtual const uiString errMsg_() const = 0;
106 
107  mClass(General) AuxInlInf
108  {
109  public:
110  AuxInlInf( int i ) : inl(i), cumnrxlines(0) {}
111 
112  int inl;
115  };
116 
117 };
#define mExpClass(module)
Definition: commondefs.h:157
TypeSet< int > xlines
Definition: cbvsio.h:114
int nrxlines_
Definition: cbvsio.h:58
PosInfo::CubeData lds_
Definition: cbvsio.h:61
bool strmclosed_
Definition: cbvsio.h:57
const uiString errMsg() const
Definition: cbvsio.h:39
CoordPol coordpol_
Definition: cbvsio.h:59
int * cnrbytes_
Definition: cbvsio.h:55
Base class for CBVS read and write manager.
Definition: cbvsio.h:72
int curnr_
Definition: cbvsio.h:103
Definition: uistring.h:88
BufferStringSet fnames_
Definition: cbvsio.h:102
Set of BufferString objects.
Definition: bufstringset.h:25
BinID curbinid_
Definition: cbvsio.h:63
uiString errmsg_
Definition: cbvsio.h:54
CoordPol
Definition: cbvsio.h:50
int nrcomps_
Definition: cbvsio.h:56
BufferString getFileName(int nr) const
Definition: cbvsio.h:89
Set of (small) copyable elements.
Definition: commontypes.h:26
static const int integersize
Definition: cbvsio.h:46
Definition: cbvsio.h:107
int nrComponents() const
Definition: cbvsio.h:42
mODTextTranslationClass(CBVSIOMgr) public
Definition: cbvsio.h:73
uiString toUiString(const DBKey &ky)
Definition: dbkey.h:117
TypeSet< Coord > trailercoords_
Definition: cbvsio.h:60
static const int headstartbytes
Definition: cbvsio.h:48
static const int version
Definition: cbvsio.h:47
void setErrMsg(const uiString s)
Definition: cbvsio.h:44
Base class for CBVS reader and writer.
Definition: cbvsio.h:28
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
bool isEmpty() const
Definition: odstring.h:49
Positioning in a seismic survey: inline/crossline or lineNr/trcNr.
Definition: binid.h:28
BufferString errmsg_
Definition: horizontracker.h:117
BufferString basefname_
Definition: cbvsio.h:100
bool failed() const
Definition: cbvsio.h:38
int inl
Definition: cbvsio.h:112
const BinID & binID() const
Definition: cbvsio.h:43
AuxInlInf(int i)
Definition: cbvsio.h:110
bool failed() const
Definition: cbvsio.h:81
const char * errMsg() const
Definition: horizontracker.h:59
CBVSIO()
Definition: cbvsio.h:32
#define mClass(module)
Definition: commondefs.h:161
Position info for an entire 3D cube. The LineData&#39;s are not sorted.
Definition: posinfo.h:96
int cumnrxlines
Definition: cbvsio.h:113
uiString errmsg_
Definition: cbvsio.h:101
const uiString errMsg() const
Definition: cbvsio.h:82

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