8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-30 19:23:03 +01:00
firebird-mirror/src/jrd/flu.h

130 lines
2.8 KiB
C
Raw Normal View History

2001-05-23 15:26:42 +02:00
/*
* PROGRAM: JRD Access Method
* MODULE: flu.h
* DESCRIPTION: Function lookup definitions
*
* The contents of this file are subject to the Interbase Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy
* of the License at http://www.Inprise.com/IPL.html
*
* Software distributed under the License is distributed on an
* "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
* or implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code was created by Inprise Corporation
* and its predecessors. Portions created by Inprise Corporation are
* Copyright (C) Inprise Corporation.
*
* All Rights Reserved.
* Contributor(s): ______________________________________.
*
* 2002.10.28 Sean Leyne - Completed removal of obsolete "HP700" port
*
2001-05-23 15:26:42 +02:00
*/
#ifndef JRD_FLU_H
#define JRD_FLU_H
2001-05-23 15:26:42 +02:00
2009-11-27 09:34:34 +01:00
// External modules for UDFs/BLOB filters/y-valve loader
#include "../common/classes/objects_array.h"
2010-10-12 10:02:57 +02:00
#include "../common/os/mod_loader.h"
#include "../common/classes/RefCounted.h"
namespace Jrd
{
class Module
{
private:
class InternalModule : public Firebird::RefCounted
{
private:
InternalModule(const InternalModule &im);
void operator=(const InternalModule &im);
public:
ModuleLoader::Module* handle;
Firebird::PathName originalName, loadName;
2011-06-04 04:18:55 +02:00
void* findSymbol(const Firebird::string& name)
{
if (! handle)
{
return 0;
}
return handle->findSymbol(name);
}
2008-12-05 01:56:15 +01:00
InternalModule(MemoryPool& p,
ModuleLoader::Module* h,
2008-12-05 01:56:15 +01:00
const Firebird::PathName& on,
const Firebird::PathName& ln)
: handle(h),
2011-06-04 04:18:55 +02:00
originalName(p, on),
loadName(p, ln)
2008-12-20 09:12:19 +01:00
{ }
~InternalModule();
bool operator==(const Firebird::PathName &pn) const
{
return originalName == pn || loadName == pn;
}
};
Firebird::RefPtr<InternalModule> interMod;
Module(InternalModule* h)
: interMod(h)
{ }
static Module lookupModule(const char*);
static InternalModule* scanModule(const Firebird::PathName& name);
2008-12-05 01:56:15 +01:00
public:
typedef Firebird::Array<InternalModule*> LoadedModules;
Module() : interMod(0) { }
explicit Module(MemoryPool&)
: interMod(NULL)
{ }
Module(MemoryPool&, const Module& m)
: interMod(m.interMod)
{ }
Module(const Module& m)
: interMod(m.interMod)
{ }
// used for UDF/BLOB Filter
static FPTR_INT lookup(const char*, const char*, Firebird::SortedObjectsArray<Module>&);
2006-11-21 14:37:06 +01:00
bool operator>(const Module &im) const;
2006-11-13 17:12:43 +01:00
void *lookupSymbol(const Firebird::string& name)
{
if (! interMod)
{
return 0;
}
return interMod->findSymbol(name);
}
2004-11-30 07:18:39 +01:00
operator bool() const
{
return interMod;
}
};
typedef Firebird::SortedObjectsArray<Module> DatabaseModules;
} // namespace Jrd
2001-05-23 15:26:42 +02:00
2009-11-27 09:34:34 +01:00
#endif // JRD_FLU_H