You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
clang format apply
This commit is contained in:
@ -26,32 +26,26 @@
|
||||
|
||||
namespace idbdatafile
|
||||
{
|
||||
|
||||
class FileFactoryBase;
|
||||
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)();
|
||||
@ -65,61 +59,60 @@ 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();
|
||||
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 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 lists the loaded plugins by type.
|
||||
*/
|
||||
static std::vector<IDBDataFile::Types> listPlugins();
|
||||
|
||||
/**
|
||||
* 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 lists the loaded plugins by type.
|
||||
*/
|
||||
static std::vector<IDBDataFile::Types> listPlugins();
|
||||
|
||||
/**
|
||||
* This retrieves the IDBFileSystem for the specified type
|
||||
*/
|
||||
static IDBFileSystem& getFs(IDBDataFile::Types type);
|
||||
/**
|
||||
* 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 const std::string& name(IDBDataFile::Types type);
|
||||
|
||||
private:
|
||||
typedef std::map<IDBDataFile::Types, FileFactoryEnt> FactoryMap;
|
||||
typedef FactoryMap::const_iterator FactoryMapCIter;
|
||||
/**
|
||||
* This retrieves the IDBFileSystem for the specified type
|
||||
*/
|
||||
static IDBFileSystem& getFs(IDBDataFile::Types type);
|
||||
|
||||
static FactoryMap s_plugins;
|
||||
/**
|
||||
* This retrieves the IDBFileSystem for the specified type
|
||||
*/
|
||||
static const std::string& name(IDBDataFile::Types type);
|
||||
|
||||
IDBFactory();
|
||||
virtual ~IDBFactory();
|
||||
private:
|
||||
typedef std::map<IDBDataFile::Types, FileFactoryEnt> FactoryMap;
|
||||
typedef FactoryMap::const_iterator FactoryMapCIter;
|
||||
|
||||
static FactoryMap s_plugins;
|
||||
|
||||
IDBFactory();
|
||||
virtual ~IDBFactory();
|
||||
};
|
||||
|
||||
inline
|
||||
const std::string& IDBFactory::name(IDBDataFile::Types type)
|
||||
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");
|
||||
}
|
||||
|
||||
return s_plugins[type].name;
|
||||
}
|
||||
if (s_plugins.find(type) == s_plugins.end())
|
||||
{
|
||||
throw std::runtime_error("unknown plugin type in IDBFactory::name");
|
||||
}
|
||||
|
||||
return s_plugins[type].name;
|
||||
}
|
||||
|
||||
} // namespace idbdatafile
|
||||
|
Reference in New Issue
Block a user