fintp_base
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ExtensionLookup.h
Go to the documentation of this file.
1 /*
2 * FinTP - Financial Transactions Processing Application
3 * Copyright (C) 2013 Business Information Systems (Allevo) S.R.L.
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>
17 * or contact Allevo at : 031281 Bucuresti, 23C Calea Vitan, Romania,
18 * phone +40212554577, office@allevo.ro <mailto:office@allevo.ro>, www.allevo.ro.
19 */
20 
21 #ifndef EXTENSIONLOOKUP_H
22 #define EXTENSIONLOOKUP_H
23 
24 #include <xalanc/Include/PlatformDefinitions.hpp>
25 #include <xalanc/XPath/Function.hpp>
26 #include <xercesc/util/PlatformUtils.hpp>
27 #include <xalanc/XalanTransformer/XalanTransformer.hpp>
28 #include <xalanc/XPath/XObjectFactory.hpp>
29 
30 #include "DatabaseProvider.h"
31 #include "Database.h"
32 
33 #include "../DllMain.h"
34 
35 XALAN_USING_XALAN(Function)
36 XALAN_USING_XALAN(XPathExecutionContext)
37 XALAN_USING_XALAN(XalanDOMString)
38 XALAN_USING_XALAN(XalanNode)
39 //XALAN_USING_XALAN(StaticStringToDOMString)
40 XALAN_USING_XALAN(XObjectPtr)
41 
42 #ifdef XALAN_1_9
43 XALAN_USING_XALAN(MemoryManagerType)
44 #endif
45 
46 namespace FinTP
47 {
48  class ExportedObject FunctionLookup : public Function
49  {
50  public:
51  virtual XObjectPtr execute( XPathExecutionContext& executionContext, XalanNode* context, const XObjectArgVectorType& args,const LocatorType* locator ) const;
52 
53  static void setDatabaseCallback( Database* ( *callback )( void ) )
54  {
55  m_CallbackDatabase = callback;
56  }
57 
58  static void setProviderCallback( DatabaseProviderFactory* ( *callback )( void ) )
59  {
60  m_CallbackProvider = callback;
61  }
62 
63  #ifdef XALAN_1_9
64  #if defined( XALAN_NO_COVARIANT_RETURN_TYPE )
65  virtual Function* clone( MemoryManagerType& theManager ) const;
66  #else
67  virtual FunctionLookup* clone( MemoryManagerType& theManager ) const;
68  #endif
69  protected:
70  const XalanDOMString& getError( XalanDOMString& theResult ) const;
71  #else
72  #if defined( XALAN_NO_COVARIANT_RETURN_TYPE )
73  virtual Function* clone() const;
74  #else
75  virtual FunctionLookup* clone() const;
76  #endif
77  protected:
78  const XalanDOMString getError() const;
79  #endif
80 
81  private:
82  // The assignment and equality operators are not implemented...
83  FunctionLookup& operator=( const FunctionLookup& );
84  bool operator==( const FunctionLookup& ) const;
85 
86  static Database* ( *m_CallbackDatabase )( void );
87  static DatabaseProviderFactory* ( *m_CallbackProvider )( void );
88 
89  /*static DatabaseProviderFactory *m_DatabaseProvider;
90 
91  static pthread_once_t DatabaseKeysCreate;
92  static pthread_key_t DatabaseKey;
93 
94  static void CreateKeys();
95  static void DeleteDatabase( void* data );
96 
97  static Database* getDatabase();
98 
99  static void Initialize();
100  static void Terminate();*/
101  };
102 }
103 
104 #endif // EXTENSIONLOOKUP_H