SCIRun  5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LinAlgFunctionCatalog.h
Go to the documentation of this file.
1 //
2 // For more information, please see: http://software.sci.utah.edu
3 //
4 // The MIT License
5 //
6 // Copyright (c) 2009 Scientific Computing and Imaging Institute,
7 // University of Utah.
8 //
9 //
10 // Permission is hereby granted, free of charge, to any person obtaining a
11 // copy of this software and associated documentation files (the "Software"),
12 // to deal in the Software without restriction, including without limitation
13 // the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 // and/or sell copies of the Software, and to permit persons to whom the
15 // Software is furnished to do so, subject to the following conditions:
16 //
17 // The above copyright notice and this permission notice shall be included
18 // in all copies or substantial portions of the Software.
19 //
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25 // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26 // DEALINGS IN THE SOFTWARE.
27 //
28 
29 #ifndef CORE_PARSER_LINALGFUNCTIONCATALOG_H
30 #define CORE_PARSER_LINALGFUNCTIONCATALOG_H 1
31 
32 #include <Core/Parser/Parser.h>
34 
35 #include <Core/Containers/LockingHandle.h>
36 #include <Core/Thread/Mutex.h>
37 
38 #include <string>
39 
40 // Include files needed for Windows
41 #include <Core/Parser/share.h>
42 
43 namespace SCIRun {
44 
45 //-----------------------------------------------------------------------------
46 // The LinAlgFunctionCatalog classes are a base class for a
47 // series of classes that define basic functionality for the parser
48 // These classes house the main functions.
49 // The base class provides functionality for registering the functions
50 // to the main ParserCatalog, which is used by the parser to look up
51 // functions
52 
54 
55  public:
58 
59  public:
60  // Add a function to the general database
61  void add_function(bool (*function)(LinAlgProgramCode& pc, std::string& str),
62  std::string function_id,
63  std::string return_type);
64 
65 
66  void add_sym_function(bool (*function)(LinAlgProgramCode& pc, std::string& str),
67  std::string function_id,
68  std::string return_type);
69 
70  static ParserFunctionCatalogHandle get_catalog();
71 };
72 
73 typedef LockingHandle<LinAlgFunctionCatalog> LinAlgFunctionCatalogHandle;
74 
75 //-----------------------------------------------------------------------------
76 // Functions for adding Functions to the LinAlgFunctionCatalog
77 
78 // Insert the basic functions into the database
82 
83 }
84 
85 #endif
Definition: LinAlgInterpreter.h:103
boost::shared_ptr< ParserFunctionCatalog > ParserFunctionCatalogHandle
Definition: Parser.h:72
#define SCISHARE
Definition: share.h:39
void SCISHARE InsertSourceSinkLinAlgFunctionCatalog(LinAlgFunctionCatalogHandle &catalog)
Definition: LinAlgFunctionSourceSink.cc:72
virtual ~LinAlgFunctionCatalog()
Definition: LinAlgFunctionCatalog.h:57
Definition: LinAlgFunctionCatalog.h:53
LinAlgFunctionCatalog()
Definition: LinAlgFunctionCatalog.h:56
Definition: Parser.h:460
void SCISHARE InsertScalarLinAlgFunctionCatalog(LinAlgFunctionCatalogHandle &catalog)
Definition: LinAlgFunctionScalar.cc:1231
LockingHandle< LinAlgFunctionCatalog > LinAlgFunctionCatalogHandle
Definition: LinAlgFunctionCatalog.h:73
void InsertBasicLinAlgFunctionCatalog(LinAlgFunctionCatalogHandle &catalog)
Definition: LinAlgFunctionBasic.cc:841