irods  4.2.8
About: iRODS (the integrated Rule Oriented Data System) is a distributed data-management system for creating data grids, digital libraries, persistent archives, and real-time data systems.
  Fossies Dox: irods-4.2.8.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

irods_database_factory.cpp
Go to the documentation of this file.
1 // =-=-=-=-=-=-=-
2 // irods includes
5 
6 namespace irods {
7 // =-=-=-=-=-=-=-
8 // super basic free factory function to create a database object
9 // of a given type
11  const std::string& _type,
13  // =-=-=-=-=-=-=-
14  // param check
15  if ( _type.empty() ) {
16  return ERROR(
18  "empty type string" );
19  }
20 
21  // given the incoming type request, create the given database object
22  if ( irods::POSTGRES_DATABASE_PLUGIN == _type ) {
23  _ptr.reset( new irods::postgres_object );
24  }
25  else if ( irods::MYSQL_DATABASE_PLUGIN == _type ) {
26  _ptr.reset( new irods::mysql_object );
27  }
28  else if ( irods::ORACLE_DATABASE_PLUGIN == _type ) {
29  _ptr.reset( new irods::oracle_object );
30  }
31  else {
32  _ptr.reset( new irods::generic_database_object(_type) );
33 
34  }
35 
36  return SUCCESS();
37 
38  } // database_factory
39 
40 }; // namespace irods
irods::ORACLE_DATABASE_PLUGIN
const std::string ORACLE_DATABASE_PLUGIN("oracle")
irods::MYSQL_DATABASE_PLUGIN
const std::string MYSQL_DATABASE_PLUGIN("mysql")
irods::mysql_object
Definition: irods_mysql_object.hpp:20
irods::database_factory
irods::error database_factory(const std::string &, irods::database_object_ptr &)
Definition: irods_database_factory.cpp:10
SYS_INVALID_INPUT_PARAM
@ SYS_INVALID_INPUT_PARAM
Definition: rodsErrorTable.h:195
irods::database_object_ptr
boost::shared_ptr< database_object > database_object_ptr
Definition: irods_database_object.hpp:62
SUCCESS
#define SUCCESS()
Definition: irods_error.hpp:121
irods
Definition: apiHandler.hpp:35
irods_database_factory.hpp
irods::generic_database_object
Definition: irods_generic_database_object.hpp:17
irods::oracle_object
Definition: irods_oracle_object.hpp:20
ERROR
#define ERROR(code_, message_)
Definition: irods_error.hpp:117
irods::error
Definition: irods_error.hpp:23
irods::POSTGRES_DATABASE_PLUGIN
const std::string POSTGRES_DATABASE_PLUGIN("postgres")
irods::postgres_object
Definition: irods_postgres_object.hpp:20
irods_client_server_negotiation.hpp