a suggestion of database i o interface n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
A suggestion of database I/O interface PowerPoint Presentation
Download Presentation
A suggestion of database I/O interface

Loading in 2 Seconds...

play fullscreen
1 / 5

A suggestion of database I/O interface - PowerPoint PPT Presentation


  • 79 Views
  • Uploaded on

A suggestion of database I/O interface. Yuan Ye 2004-3-10. Current interface. void Get_GeoMdcTube(vector<GeoMdcTube>& VecB); void Get_GeoMdcWire(vector<GeoMdcWire> &VecC); void Get_MdcSignalLayer2AllLayer(vector<MdcSignalLayer2AllLayer> &VecD); void Set_GeoMdcWire();

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'A suggestion of database I/O interface' - duff


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
current interface
Current interface

void Get_GeoMdcTube(vector<GeoMdcTube>& VecB);

void Get_GeoMdcWire(vector<GeoMdcWire> &VecC);

void Get_MdcSignalLayer2AllLayer(vector<MdcSignalLayer2AllLayer> &VecD);

void Set_GeoMdcWire();

void Set_GeoMdcTube();

void Set_BesGeoMdc();

void Set_MdcSignalLayer2AllLayer();

void Open(char *fDatabaseName,char *fHostName,char *fPort,char *fOptions);

void Close(PGconn *conn);

~DB2BesGeoMdc();

};

#ifndef __DB2BesGeoMdc_h

#define __DB2BesGeoMdc_h

#include <vector>

#include "BesGeoMdc.h"

#include "GeoMdcTube.h"

#include "GeoMdcWire.h"

#include "MdcSignalLayer2AllLayer.h"

using namespace std;

#include </usr/include/pgsql/libpq-fe.h>

class DB2BesGeoMdc

{public:

void Get_BesGeoMdc(vector<BesGeoMdc> &VecA);

stream type i o interface
Stream type I/O interface
  • Table independent
  • Manpower economical
  • Depress error possibility
  • Common interface, user needn’t to know

how database organized

an example besdbio h
An example BesDBIO.h

void Skip(int);

void SkipLine(void);

private:

void Exit_db(PGconn *);

private:

int rowPointer,columnPointer;

PGresult *res;

PGconn *conn;

};

#endif //BesDBIO_H

#ifndef BesDBIO_H

#define BesDBIO_H

using namespace std;

#include </usr/include/pgsql/libpq-fe.h>

class BesDBIO

{

public:

BesDBIO(char*);

~BesDBIO(void);

BesDBIO& operator>>(int&);

BesDBIO& operator>>(float&);

BesDBIO& operator>>(double&);

BesDBIO& operator>>(char*);

how to use
How to use

#include "BesDBIO.h "

BesDBIO mdcIO("geomdcsegmentinfo");

for(i=0; i<fSegmentNo; i++){

mdcIO>>name>>length>>innerR>>outR>>z;

mdcIO.SkipLine();

fMdcSegment[i].SetName(name);

fMdcSegment[i].SetLength(length);

fMdcSegment[i].SetInnerR(innerR);

fMdcSegment[i].SetOutR(outR);

fMdcSegment[i].SetZ(z);

}

Name Length InnerR OutR Z

mm mm mm mm

Mdc 2582 59 810 0

OutCylinder 2206 790 801.5 0

InnerCylinder 780 63.5 64.5 0

MiddleClip 30 790 810 1118

BelowClip 20 778 810 1143

RightClip 18 796 810 1162

Tail 120 800 810 1231

OutEndPlane1 18 743.6 794 1162

OutEndPlane2 18 728.3 743.6 1159

OutEndPlane3 18 711.5 728.3 1156

OutEndPlane4 18 695 711.5 1153

OutEndPlane5 18 678.8 695 1150

OutEndPlane6 18 662.8 678.8 1147