Database.h
1 //##################################################################################################
2 //
3 // Ceetron Export
4 // Component: VTFx
5 //
6 // --------------------------------------------------------------------------------------------
7 // Copyright (C) 2015, Ceetron AS
8 // This is UNPUBLISHED PROPRIETARY SOURCE CODE of Ceetron AS. The contents of this file may
9 // not be disclosed to third parties, copied or duplicated in any form, in whole or in part,
10 // without the prior written permission of Ceetron AS.
11 //##################################################################################################
12 
13 #pragma once
14 
15 #include "CeeVTFx/Base.h"
16 #include "CeeVTFx/Block.h"
17 
18 #include "CeeCore/RefCountedObject.h"
19 #include "CeeCore/Str.h"
20 #include "CeeCore/PtrRef.h"
21 
22 namespace cee {
23 namespace vtfx {
24 
25 class File;
26 
27 //==================================================================================================
28 //
29 //
30 //
31 //==================================================================================================
32 class CEE_VTFX_EXPORT Database : public RefCountedObject
33 {
34 public:
35  // Simulation and solution types for SimulationInfoBlock
36  // ----------------------------------------------------
37  enum SimulationType
38  {
39  SIMULATION_TYPE_STRUCTURAL = 0,
40  SIMULATION_TYPE_THERMAL = 1,
41  SIMULATION_TYPE_ELECTRIC = 2,
42  SIMULATION_TYPE_MAGNETIC = 3,
43  SIMULATION_TYPE_FLUID = 4,
44  SIMULATION_TYPE_ACOUSTIC = 5,
45  SIMULATION_TYPE_DIFFUSION = 6,
46  SIMULATION_TYPE_OTHER = 7
47  };
48 
49 
50  enum SolutionType
51  {
52  SOLUTION_TYPE_STATIC = 0,
53  SOLUTION_TYPE_STEADY_STATE = 1,
54  SOLUTION_TYPE_VIBRATION = 2,
55  SOLUTION_TYPE_BUCKLING = 3,
56  SOLUTION_TYPE_TRANSIENT = 4,
57  SOLUTION_TYPE_SUPERELEMENT = 5,
58  SOLUTION_TYPE_FREQRESPONSE = 6,
59  SOLUTION_TYPE_COMPLEXEIGEN = 7,
60  SOLUTION_TYPE_QUASISTATIC = 8,
61  SOLUTION_TYPE_OUTPUT = 9,
62  SOLUTION_TYPE_SINGULAR = 10,
63  SOLUTION_TYPE_OTHER = 11
64  };
65 
66 public:
67  Database(File* file, const Str& databaseName, int databaseId, SimulationType simulationType = SIMULATION_TYPE_OTHER, SolutionType solutionType = SOLUTION_TYPE_OTHER, const Str& description = "");
68  virtual ~Database();
69 
70  int id() const;
71  Str name() const;
72 
73  bool writeBlock(const Block* block);
74 
75  size_t blockCount(Block::BlockType blockType) const;
76  PtrRef<Block> blockByIndex(Block::BlockType blockType, size_t blockIndex);
77  PtrRef<Block> blockById(Block::BlockType blockType, int blockId);
78 
79 private:
80  Database(File* file, int databaseId);
81  bool internal_parse();
82 
83 private:
84  friend class FilePrivate;
85  friend class File;
86 
87  CEE_PRIVATE_IMPL(Database);
88  CEE_DISALLOW_COPY_AND_ASSIGN(Database);
89 };
90 
91 }
92 }
Namespace cee contains all functionality and structures under the Core component. ...
Definition: AppAssert.cpp:18
A VTFx file.
Definition: File.h:35
A VTFx database. The class represents a database of data blocks.
Definition: Database.h:32
A general unicode based string class.
Definition: Str.h:28
Smart pointer class used for handling reference counted objects (that derive from Object)...
Definition: PtrRef.h:26
BlockType
Global block type constants used by Ceetron Export. Normally users do not need these, except for some methods of TransformationResultValuesBlock.
Definition: Block.h:35
Base class for all reference counted objects with built-in support for intrusive reference counting...
Definition: RefCountedObject.h:34
Abstract base class for all VTFx blocks.
Definition: Block.h:29