IBPP Namespace Reference


Data Structures

class  Date
class  DBKey
class  EventInterface
class  Exception
class  IArray
class  IBlob
class  IDatabase
class  IEvents
class  IRow
class  IService
class  IStatement
class  ITransaction
class  LogicException
class  Ptr
class  SQLException
class  Time
class  Timestamp
class  User
class  WrongType

Typedefs

typedef Ptr< IArrayArray
typedef Ptr< IBlobBlob
typedef Ptr< IDatabaseDatabase
typedef Ptr< IEventsEvents
typedef Ptr< IRowRow
typedef Ptr< IServiceService
typedef Ptr< IStatementStatement
typedef Ptr
< ITransaction
Transaction

Enumerations

enum  ADT {
  adDate, adTime, adTimestamp, adString,
  adBool, adInt16, adInt32, adInt64,
  adFloat, adDouble
}
enum  BRF {
  brVerbose = 0x1, brIgnoreChecksums = 0x100, brIgnoreLimbo = 0x200, brMetadataOnly = 0x400,
  brNoGarbageCollect = 0x800, brNonTransportable = 0x1000, brConvertExtTables = 0x2000, brReplace = 0x10000,
  brDeactivateIdx = 0x20000, brNoShadow = 0x40000, brNoValidity = 0x80000, brPerTableCommit = 0x100000,
  brUseAllSpace = 0x200000
}
enum  DSM { dsForce, dsDenyTrans, dsDenyAttach }
enum  RPF {
  rpMendRecords = 0x1, rpValidatePages = 0x2, rpValidateFull = 0x4, rpReadOnly = 0x100,
  rpIgnoreChecksums = 0x200, rpKillShadows = 0x400
}
enum  SDT {
  sdArray, sdBlob, sdDate, sdTime,
  sdTimestamp, sdString, sdSmallint, sdInteger,
  sdLargeint, sdFloat, sdDouble
}
enum  STT {
  stUnknown, stUnsupported, stSelect, stInsert,
  stUpdate, stDelete, stDDL, stExecProcedure,
  stSelectUpdate, stSetGenerator, stSavePoint
}
enum  TAM { amWrite, amRead }
enum  TFF { tfIgnoreLimbo = 0x1, tfAutoCommit = 0x2, tfNoAutoUndo = 0x4 }
enum  TIL { ilConcurrency, ilReadDirty, ilReadCommitted, ilConsistency }
enum  TLR { lrWait, lrNoWait }
enum  TTR { trSharedWrite, trSharedRead, trProtectedWrite, trProtectedRead }

Functions

Array ArrayFactory (Database db, Transaction tr)
Blob BlobFactory (Database db, Transaction tr)
bool CheckVersion (uint32_t AppVersion)
void ClientLibSearchPaths (const std::string &)
Database DatabaseFactory (const std::string &ServerName, const std::string &DatabaseName, const std::string &UserName, const std::string &UserPassword)
Database DatabaseFactory (const std::string &ServerName, const std::string &DatabaseName, const std::string &UserName, const std::string &UserPassword, const std::string &RoleName, const std::string &CharSet, const std::string &CreateParams)
bool dtoi (int date, int *y, int *m, int *d)
Events EventsFactory (Database db)
int GDSVersion ()
bool itod (int *pdate, int year, int month, int day)
void itot (int *ptime, int hour, int minute, int second=0, int tenthousandths=0)
Service ServiceFactory (const std::string &ServerName, const std::string &UserName, const std::string &UserPassword)
Statement StatementFactory (Database db, Transaction tr)
Statement StatementFactory (Database db, Transaction tr, const std::string &sql)
Transaction TransactionFactory (Database db, TAM am, TIL il, TLR lr, TFF flags)
void ttoi (int itime, int *phour, int *pminute, int *psecond, int *ptt)

Variables

const int MaxDate = 2958464
const int MinDate = -693594
const uint32_t Version = (2<<24) + (5<<16) + (3<<8) + 1


Typedef Documentation

typedef Ptr<IArray> IBPP::Array

Definition at line 451 of file ibpp.h.

typedef Ptr<IBlob> IBPP::Blob

Definition at line 450 of file ibpp.h.

typedef Ptr<IDatabase> IBPP::Database

Definition at line 453 of file ibpp.h.

typedef Ptr<IEvents> IBPP::Events

Definition at line 456 of file ibpp.h.

typedef Ptr<IRow> IBPP::Row

Definition at line 457 of file ibpp.h.

typedef Ptr<IService> IBPP::Service

Definition at line 452 of file ibpp.h.

typedef Ptr<IStatement> IBPP::Statement

Definition at line 455 of file ibpp.h.

typedef Ptr<ITransaction> IBPP::Transaction

Definition at line 454 of file ibpp.h.


Enumeration Type Documentation

enum IBPP::ADT

Enumerator:
adDate 
adTime 
adTimestamp 
adString 
adBool 
adInt16 
adInt32 
adInt64 
adFloat 
adDouble 

Definition at line 127 of file ibpp.h.

enum IBPP::BRF

Enumerator:
brVerbose 
brIgnoreChecksums 
brIgnoreLimbo 
brMetadataOnly 
brNoGarbageCollect 
brNonTransportable 
brConvertExtTables 
brReplace 
brDeactivateIdx 
brNoShadow 
brNoValidity 
brPerTableCommit 
brUseAllSpace 

Definition at line 134 of file ibpp.h.

00134                  {
00135                 brVerbose = 0x1,
00136                 // Backup flags
00137                 brIgnoreChecksums = 0x100, brIgnoreLimbo = 0x200,
00138                 brMetadataOnly = 0x400, brNoGarbageCollect = 0x800,
00139                 brNonTransportable = 0x1000, brConvertExtTables = 0x2000,
00140                 // Restore flags
00141                 brReplace = 0x10000, brDeactivateIdx = 0x20000,
00142                 brNoShadow = 0x40000, brNoValidity = 0x80000,
00143                 brPerTableCommit = 0x100000, brUseAllSpace = 0x200000
00144         };

enum IBPP::DSM

Enumerator:
dsForce 
dsDenyTrans 
dsDenyAttach 

Definition at line 131 of file ibpp.h.

enum IBPP::RPF

Enumerator:
rpMendRecords 
rpValidatePages 
rpValidateFull 
rpReadOnly 
rpIgnoreChecksums 
rpKillShadows 

Definition at line 147 of file ibpp.h.

00148         {
00149                 // Mandatory and mutually exclusives
00150                 rpMendRecords = 0x1, rpValidatePages = 0x2, rpValidateFull = 0x4,
00151                 // Options
00152                 rpReadOnly = 0x100, rpIgnoreChecksums = 0x200, rpKillShadows = 0x400
00153         };

enum IBPP::SDT

Enumerator:
sdArray 
sdBlob 
sdDate 
sdTime 
sdTimestamp 
sdString 
sdSmallint 
sdInteger 
sdLargeint 
sdFloat 
sdDouble 

Definition at line 123 of file ibpp.h.

enum IBPP::STT

Enumerator:
stUnknown 
stUnsupported 
stSelect 
stInsert 
stUpdate 
stDelete 
stDDL 
stExecProcedure 
stSelectUpdate 
stSetGenerator 
stSavePoint 

Definition at line 118 of file ibpp.h.

enum IBPP::TAM

Enumerator:
amWrite 
amRead 

Definition at line 106 of file ibpp.h.

00106 {amWrite, amRead};

enum IBPP::TFF

Enumerator:
tfIgnoreLimbo 
tfAutoCommit 
tfNoAutoUndo 

Definition at line 156 of file ibpp.h.

00156 {tfIgnoreLimbo = 0x1, tfAutoCommit = 0x2, tfNoAutoUndo = 0x4};

enum IBPP::TIL

Enumerator:
ilConcurrency 
ilReadDirty 
ilReadCommitted 
ilConsistency 

Definition at line 109 of file ibpp.h.

enum IBPP::TLR

Enumerator:
lrWait 
lrNoWait 

Definition at line 112 of file ibpp.h.

00112 {lrWait, lrNoWait};

enum IBPP::TTR

Enumerator:
trSharedWrite 
trSharedRead 
trProtectedWrite 
trProtectedRead 

Definition at line 115 of file ibpp.h.


Function Documentation

Array IBPP::ArrayFactory ( Database  db,
Transaction  tr 
)

Definition at line 349 of file _ibpp.cpp.

References ibpp_internals::GDS::Call(), ibpp_internals::gds, and IBPP::Ptr< T >::intf().

00350         {
00351                 (void)gds.Call();                       // Triggers the initialization, if needed
00352                 return new ArrayImpl(dynamic_cast<DatabaseImpl*>(db.intf()),
00353                                                         dynamic_cast<TransactionImpl*>(tr.intf()));
00354         }

Blob IBPP::BlobFactory ( Database  db,
Transaction  tr 
)

Definition at line 342 of file _ibpp.cpp.

References ibpp_internals::GDS::Call(), ibpp_internals::gds, and IBPP::Ptr< T >::intf().

Referenced by TeFirebirdPortal::getBlob(), TeFirebirdPortal::getData(), TeFirebird::insertBlob(), TeFirebird::insertLine(), TeFirebird::insertPolygon(), TeFirebird::insertRasterBlock(), loadFromBlob(), TeFirebird::updateLine(), and TeFirebird::updatePolygon().

00343         {
00344                 (void)gds.Call();                       // Triggers the initialization, if needed
00345                 return new BlobImpl(dynamic_cast<DatabaseImpl*>(db.intf()),
00346                                                         dynamic_cast<TransactionImpl*>(tr.intf()));
00347         }

bool IBPP::CheckVersion ( uint32_t  AppVersion  ) 

Definition at line 283 of file _ibpp.cpp.

References Version.

00284         {
00285                 //(void)gds.Call();             // Just call it to trigger the initialization
00286                 return (AppVersion & 0xFFFFFF00) ==
00287                                 (IBPP::Version & 0xFFFFFF00) ? true : false;
00288         }

void IBPP::ClientLibSearchPaths ( const std::string  ) 

Definition at line 301 of file _ibpp.cpp.

00302         {
00303         }

Database IBPP::DatabaseFactory ( const std::string ServerName,
const std::string DatabaseName,
const std::string UserName,
const std::string UserPassword 
) [inline]

Definition at line 872 of file ibpp.h.

References DatabaseFactory().

00875                 { return DatabaseFactory(ServerName, DatabaseName, UserName, UserPassword, "", "", ""); }

Database IBPP::DatabaseFactory ( const std::string ServerName,
const std::string DatabaseName,
const std::string UserName,
const std::string UserPassword,
const std::string RoleName,
const std::string CharSet,
const std::string CreateParams 
)

Definition at line 315 of file _ibpp.cpp.

References ibpp_internals::GDS::Call(), and ibpp_internals::gds.

Referenced by TeFirebird::connect(), DatabaseFactory(), and TeFirebird::newDatabase().

00319         {
00320                 (void)gds.Call();                       // Triggers the initialization, if needed
00321                 return new DatabaseImpl(ServerName, DatabaseName, UserName,
00322                                                                 UserPassword, RoleName, CharSet, CreateParams);
00323         }

bool IBPP::dtoi ( int  date,
int *  y,
int *  m,
int *  d 
)

Definition at line 156 of file date.cpp.

References ibpp_internals::consts::Dec31_1899, and MaxDate.

Referenced by IBPP::Date::Add(), IBPP::Date::Day(), IBPP::Date::EndOfMonth(), IBPP::Date::GetDate(), IBPP::Date::Month(), IBPP::Date::SetDate(), IBPP::Date::StartOfMonth(), and IBPP::Date::Year().

00157 {
00158     int RataDie, Z, H, A, B, C;
00159     int year, month, day;
00160 
00161         // Validity control.
00162         if (date < IBPP::MinDate || date > IBPP::MaxDate)
00163                 return false;
00164 
00165         // The "Rata Die" is the date specified as the number of days elapsed since
00166         // 31 Dec of year 0. So 1 Jan 0001 is 1.
00167 
00168         RataDie = date + ibpp_internals::consts::Dec31_1899;    // Because IBPP sets the '0' on 31 Dec 1899.
00169 
00170     Z = RataDie + 306;
00171     H = 100*Z - 25;
00172     A = H/3652425;
00173     B = A - A/4;
00174     year = (100*B + H) / 36525;
00175     C = B + Z - 365*year - year / 4;
00176     month = (5*C + 456) / 153;
00177     day = C - (153*month - 457) / 5;
00178     if (month > 12) { year += 1; month -= 12; }
00179 
00180         if (y != 0) *y = (int)year;
00181         if (m != 0) *m = (int)month;
00182         if (d != 0) *d = (int)day;
00183 
00184         return true;
00185 }

Events IBPP::EventsFactory ( Database  db  ) 

Definition at line 356 of file _ibpp.cpp.

References ibpp_internals::GDS::Call(), ibpp_internals::gds, and IBPP::Ptr< T >::intf().

00357         {
00358                 (void)gds.Call();                       // Triggers the initialization, if needed
00359                 return new EventsImpl(dynamic_cast<DatabaseImpl*>(db.intf()));
00360         }

int IBPP::GDSVersion (  ) 

Definition at line 290 of file _ibpp.cpp.

References ibpp_internals::GDS::Call(), ibpp_internals::gds, and ibpp_internals::GDS::mGDSVersion.

00291         {
00292                 return gds.Call()->mGDSVersion;
00293         }

bool IBPP::itod ( int *  pdate,
int  year,
int  month,
int  day 
)

Definition at line 190 of file date.cpp.

References ibpp_internals::consts::Dec31_1899, and MaxDate.

Referenced by IBPP::Date::EndOfMonth(), IBPP::Date::SetDate(), IBPP::Date::StartOfMonth(), and IBPP::Date::Today().

00191 {
00192     int RataDie, result;
00193         int y, m, d;
00194 
00195         d = day;        m = month;              y = year;
00196     if (m < 3) { m += 12; y -= 1; }
00197     RataDie = d + (153*m - 457) / 5 + 365*y + y/4 - y/100 + y/400 - 306;
00198 
00199         result = RataDie - ibpp_internals::consts::Dec31_1899;   // Because IBPP sets the '0' on 31 Dec 1899
00200 
00201         // Validity control
00202         if (result < IBPP::MinDate || result > IBPP::MaxDate)
00203                 return false;
00204 
00205         *pdate = result;
00206         return true;
00207 }

void IBPP::itot ( int *  ptime,
int  hour,
int  minute,
int  second = 0,
int  tenthousandths = 0 
)

Definition at line 151 of file time.cpp.

Referenced by IBPP::Time::Now(), and IBPP::Time::SetTime().

00152 {
00153         *ptime = hour * 36000000 + minute * 600000 + second * 10000 + tenthousandths;
00154         return;
00155 }

Service IBPP::ServiceFactory ( const std::string ServerName,
const std::string UserName,
const std::string UserPassword 
)

Definition at line 308 of file _ibpp.cpp.

References ibpp_internals::GDS::Call(), and ibpp_internals::gds.

Referenced by TeFirebird::newDatabase().

00310         {
00311                 (void)gds.Call();                       // Triggers the initialization, if needed
00312                 return new ServiceImpl(ServerName, UserName, UserPassword);
00313         }

Statement IBPP::StatementFactory ( Database  db,
Transaction  tr 
) [inline]

Definition at line 883 of file ibpp.h.

References StatementFactory().

00884                 { return StatementFactory(db, tr, ""); }

Statement IBPP::StatementFactory ( Database  db,
Transaction  tr,
const std::string sql 
)

Definition at line 333 of file _ibpp.cpp.

References ibpp_internals::GDS::Call(), ibpp_internals::gds, and IBPP::Ptr< T >::intf().

Referenced by TeFirebird::execute(), TeFirebirdPortal::fetchRow(), TeFirebirdPortal::freeResult(), TeFirebird::generateLabelPositions(), generateLablesForPolygonal(), TeFirebird::insertBlob(), TeFirebird::insertLine(), TeFirebird::insertPolygon(), TeFirebird::insertRasterBlock(), TeFirebirdPortal::query(), StatementFactory(), TeFirebird::updateLine(), and TeFirebird::updatePolygon().

00335         {
00336                 (void)gds.Call();                       // Triggers the initialization, if needed
00337                 return new StatementImpl(       dynamic_cast<DatabaseImpl*>(db.intf()),
00338                                                                         dynamic_cast<TransactionImpl*>(tr.intf()),
00339                                                                         sql);
00340         }

Transaction IBPP::TransactionFactory ( Database  db,
TAM  am,
TIL  il,
TLR  lr,
TFF  flags 
)

Definition at line 325 of file _ibpp.cpp.

References ibpp_internals::GDS::Call(), ibpp_internals::gds, and IBPP::Ptr< T >::intf().

Referenced by TeFirebird::connect(), TeFirebird::generateLabelPositions(), generateLablesForPolygonal(), TeFirebirdPortal::query(), and TeFirebird::setConnection().

00327         {
00328                 (void)gds.Call();                       // Triggers the initialization, if needed
00329                 return new TransactionImpl(     dynamic_cast<DatabaseImpl*>(db.intf()),
00330                                                                         am, il, lr, flags);
00331         }

void IBPP::ttoi ( int  itime,
int *  phour,
int *  pminute,
int *  psecond,
int *  ptt 
)

Definition at line 132 of file time.cpp.

Referenced by IBPP::Time::GetTime(), IBPP::Time::Hours(), IBPP::Time::Minutes(), IBPP::Time::Seconds(), and IBPP::Time::SubSeconds().

00133 {
00134         int hh, mm, ss, tt;
00135 
00136         hh = (int) (itime / 36000000);  itime = itime - hh * 36000000;
00137         mm = (int) (itime / 600000);    itime = itime - mm * 600000;
00138         ss = (int) (itime / 10000);
00139         tt = (int) (itime - ss * 10000);
00140 
00141         if (h != 0) *h = hh;
00142         if (m != 0) *m = mm;
00143         if (s != 0) *s = ss;
00144         if (t != 0) *t = tt;
00145 
00146         return;
00147 }


Variable Documentation

const int IBPP::MaxDate = 2958464

Definition at line 103 of file ibpp.h.

Referenced by dtoi(), and itod().

const int IBPP::MinDate = -693594

Definition at line 102 of file ibpp.h.

Referenced by IBPP::Date::Clear().

const uint32_t IBPP::Version = (2<<24) + (5<<16) + (3<<8) + 1

Definition at line 99 of file ibpp.h.

Referenced by CheckVersion().


Generated on Sun Jul 29 04:12:08 2012 for TerraLib - Development Source by  doxygen 1.5.3