xc
OracleDatastore.h
1 // -*-c++-*-
2 //----------------------------------------------------------------------------
3 // XC program; finite element analysis code
4 // for structural analysis and design.
5 //
6 // Copyright (C) Luis C. Pérez Tato
7 //
8 // This program derives from OpenSees <http://opensees.berkeley.edu>
9 // developed by the «Pacific earthquake engineering research center».
10 //
11 // Except for the restrictions that may arise from the copyright
12 // of the original program (see copyright_opensees.txt)
13 // XC is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // This software is distributed in the hope that it will be useful, but
19 // WITHOUT ANY WARRANTY; without even the implied warranty of
20 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 // GNU General Public License for more details.
22 //
23 //
24 // You should have received a copy of the GNU General Public License
25 // along with this program.
26 // If not, see <http://www.gnu.org/licenses/>.
27 //----------------------------------------------------------------------------
28 
29 #ifndef OracleDatastore_h
30 #define OracleDatastore_h
31 
32 // $Revision: 1.2 $
33 // $Date: 2005/11/07 21:34:25 $
34 // $Source: /usr/local/cvs/OpenSees/SRC/database/OracleDatastore.h,v $
35 
36 // Written: Jun Peng
37 //
38 // Description: This file contains the class definition for OracleDatastore.
39 //
40 // What: "@(#) OracleDatastore.h, revA"
41 
42 #include "DBDatastore.h"
43 #include <fstream>
44 
45 namespace XC {
46 class FEM_ObjectBroker;
47 
48 
50 //
52 //
58  {
59  private:
60 
61  // private attributes
62  int projTag;
63 
64  int lastDomainChangeStamp;
65  public:
66  OracleDatastore(const std::string &, Preprocessor &, FEM_ObjectBroker &);
67 
68  ~OracleDatastore(void);
69 
70  // methods to set and get a project tag
71  int getProjTag();
72  void setProjTag(int projectID);
73 
74  // method to search for project Tag
75  int searchProjTag(const std::string &projName);
76 
77  // methods defined in the Channel class interface which do nothing
78  std::string addToProgram(void);
79  int setUpShadow(void);
80  int setUpActor(void);
81  int setNextAddress(const ChannelAddress &otherChannelAddress);
83 
84  int commitState(int commitTag);
85 
86  std::string getTypeId(void) const
87  { return "Oracle"; }
88 
89  // methods for sending and receiving the data
90  int sendObj(int commitTag,MovableObject &,ChannelAddress *theAddress= nullptr);
91  int recvObj(int commitTag,MovableObject &theObject, FEM_ObjectBroker &,ChannelAddress *theAddress= nullptr);
92 
93  int sendMsg(int dbTag, int commitTag,const Message &,ChannelAddress *theAddress= nullptr);
94  int recvMsg(int dbTag, int commitTag,Message &,ChannelAddress *theAddress= nullptr);
95 
96  int sendMatrix(int dbTag, int commitTag,const Matrix &,ChannelAddress *theAddress= nullptr);
97  int recvMatrix(int dbTag, int commitTag,Matrix &,ChannelAddress *theAddress= nullptr);
98 
99  int sendVector(int dbTag, int commitTag,const Vector &, ChannelAddress *theAddress= nullptr);
100  int recvVector(int dbTag, int commitTag,Vector &,ChannelAddress *theAddress= nullptr);
101 
102  int sendID(int dbTag, int commitTag, const ID &, ChannelAddress *theAddress= nullptr);
103  int recvID(int dbTag, int commitTag, ID &theID, ChannelAddress *theAddress= nullptr);
104  };
105 } // end of XC namespace
106 
107 
108 #endif
109 
Base class for classes that store model information on a database.
Definition: DBDatastore.h:40
Float vector abstraction.
Definition: Vector.h:94
Store model data in a Oracle database.
Definition: OracleDatastore.h:57
Finite element model generation tools.
Definition: Preprocessor.h:59
ChannelAddress * getLastSendersAddress(void)
Return .
Definition: OracleDatastore.cpp:147
int sendMatrix(int dbTag, int commitTag, const Matrix &, ChannelAddress *theAddress=nullptr)
Invoked to receive the data in the Matrix object theMatrix to another Channel object.
Definition: OracleDatastore.cpp:181
Object that can move between processes.
Definition: MovableObject.h:100
int recvVector(int dbTag, int commitTag, Vector &, ChannelAddress *theAddress=nullptr)
Invoked to receive the data in the Vector object theVector to another Channel object.
Definition: OracleDatastore.cpp:271
int recvMsg(int dbTag, int commitTag, Message &, ChannelAddress *theAddress=nullptr)
Invoked to send the data in the Message object theMsg to another Channel object.
Definition: OracleDatastore.cpp:174
FEM_ObjectBroker is is an object broker class for the finite element method.
Definition: FEM_ObjectBroker.h:151
Vector of integers.
Definition: ID.h:95
int sendObj(int commitTag, MovableObject &, ChannelAddress *theAddress=nullptr)
Call {sendSelf(commitTag, *this, theBroker)} on theObject and return the result.
Definition: OracleDatastore.cpp:161
int setNextAddress(const ChannelAddress &otherChannelAddress)
Return .
Definition: OracleDatastore.cpp:143
int setUpShadow(void)
Return .
Definition: OracleDatastore.cpp:136
int sendVector(int dbTag, int commitTag, const Vector &, ChannelAddress *theAddress=nullptr)
Invoked to receive the data in the Vector object theVector to another Channel object.
Definition: OracleDatastore.cpp:242
int sendID(int dbTag, int commitTag, const ID &, ChannelAddress *theAddress=nullptr)
Invoked to receive the data in the ID object theID to another Channel object.
Definition: OracleDatastore.cpp:288
std::string addToProgram(void)
Return .
Definition: OracleDatastore.cpp:132
int recvMatrix(int dbTag, int commitTag, Matrix &, ChannelAddress *theAddress=nullptr)
Invoked to receive the data in the Matrix object theMatrix to another Channel object.
Definition: OracleDatastore.cpp:220
int setUpActor(void)
Return .
Definition: OracleDatastore.cpp:140
Message between processes.
Definition: Message.h:77
int recvID(int dbTag, int commitTag, ID &theID, ChannelAddress *theAddress=nullptr)
Invoked to receive the data in the ID object theID to another Channel object.
Definition: OracleDatastore.cpp:318
Open source finite element program for structural analysis.
Definition: ContinuaReprComponent.h:35
Base class for classes that encapsulate channel addresses.
Definition: ChannelAddress.h:78
Matrix of floats.
Definition: Matrix.h:111
int recvObj(int commitTag, MovableObject &theObject, FEM_ObjectBroker &, ChannelAddress *theAddress=nullptr)
Call {recvSelf(commitTag, *this, theBroker)} on theObject and return the result.
Definition: OracleDatastore.cpp:164
int commitState(int commitTag)
Stores the current state on the database.
Definition: OracleDatastore.cpp:155
int sendMsg(int dbTag, int commitTag, const Message &, ChannelAddress *theAddress=nullptr)
A method invoked to send the data in the Message object theMsg to another Channel object...
Definition: OracleDatastore.cpp:168