1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -32,26 +32,26 @@ class IDBFileSystem;
struct FileFactoryEnt
{
FileFactoryEnt() :
type(IDBDataFile::UNKNOWN),
name("unknown"),
factory(0),
filesystem(0) {;}
FileFactoryEnt() :
type(IDBDataFile::UNKNOWN),
name("unknown"),
factory(0),
filesystem(0) {;}
FileFactoryEnt(
IDBDataFile::Types t,
const std::string& n,
FileFactoryBase* f,
IDBFileSystem* fs) :
type(t),
name(n),
factory(f),
filesystem(fs) {;}
FileFactoryEnt(
IDBDataFile::Types t,
const std::string& n,
FileFactoryBase* f,
IDBFileSystem* fs) :
type(t),
name(n),
factory(f),
filesystem(fs) {;}
IDBDataFile::Types type;
std::string name;
FileFactoryBase* factory;
IDBFileSystem* filesystem;
IDBDataFile::Types type;
std::string name;
FileFactoryBase* factory;
IDBFileSystem* filesystem;
};
typedef FileFactoryEnt (*FileFactoryEntryFunc)();
@ -66,54 +66,54 @@ typedef FileFactoryEnt (*FileFactoryEntryFunc)();
class IDBFactory
{
public:
/**
* This method installs the default plugs for Buffered and Unbuffered files.
* It is called automatically from the IDBPolicy::init() body so that clients
* don't have to worry about it.
*/
static bool installDefaultPlugins();
/**
* This method installs the default plugs for Buffered and Unbuffered files.
* It is called automatically from the IDBPolicy::init() body so that clients
* don't have to worry about it.
*/
static bool installDefaultPlugins();
/**
* This method installs a dynamic plugin. The plugin argument must refer
* to a ".so" file that exposes an extern "C" functions:
* FileFactoryEnt plugin_instance()
*/
static bool installPlugin(const std::string& plugin);
/**
* This method installs a dynamic plugin. The plugin argument must refer
* to a ".so" file that exposes an extern "C" functions:
* FileFactoryEnt plugin_instance()
*/
static bool installPlugin(const std::string& plugin);
/**
* This method calls the Factory for the specified type
*/
static IDBDataFile* open(IDBDataFile::Types type, const char* fname, const char* mode, unsigned opts, unsigned colWidth);
/**
* This method calls the Factory for the specified type
*/
static IDBDataFile* open(IDBDataFile::Types type, const char* fname, const char* mode, unsigned opts, unsigned colWidth);
/**
* This retrieves the IDBFileSystem for the specified type
*/
static IDBFileSystem& getFs(IDBDataFile::Types type);
/**
* This retrieves the IDBFileSystem for the specified type
*/
static IDBFileSystem& getFs(IDBDataFile::Types type);
/**
* This retrieves the IDBFileSystem for the specified type
*/
static const std::string& name(IDBDataFile::Types type);
/**
* This retrieves the IDBFileSystem for the specified type
*/
static const std::string& name(IDBDataFile::Types type);
private:
typedef std::map<IDBDataFile::Types,FileFactoryEnt> FactoryMap;
typedef FactoryMap::const_iterator FactoryMapCIter;
typedef std::map<IDBDataFile::Types, FileFactoryEnt> FactoryMap;
typedef FactoryMap::const_iterator FactoryMapCIter;
static FactoryMap s_plugins;
static FactoryMap s_plugins;
IDBFactory();
virtual ~IDBFactory();
IDBFactory();
virtual ~IDBFactory();
};
inline
const std::string& IDBFactory::name(IDBDataFile::Types type)
{
if( s_plugins.find(type) == s_plugins.end() )
{
throw std::runtime_error("unknown plugin type in IDBFactory::name");
}
if ( s_plugins.find(type) == s_plugins.end() )
{
throw std::runtime_error("unknown plugin type in IDBFactory::name");
}
return s_plugins[type].name;
return s_plugins[type].name;
}
}