Sierra Toolkit Version of the Day
UserPlugin.hpp File Reference
#include <memory>
#include <map>
#include <vector>
#include <string>
#include <typeinfo>
#include <stk_util/diag/StringUtil.hpp>
#include <stk_util/util/Fortran.hpp>
#include <stk_util/diag/Writer_fwd.hpp>
Include dependency graph for UserPlugin.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  sierra::Plugin::Registry
struct  sierra::Plugin::Registry::less_nocase
 Class hash_nocase implements a hash, case insensitive NamePair hash functor. More...
class  sierra::Plugin::UserPlugin< Creator, S >
class  sierra::Plugin::UserPlugin< Creator, S >::Register< DerivedClass >
 Class template Register registers the createInstance() function with the derived_name on object creation. More...
class  sierra::Plugin::UserSubroutine< S >
class  sierra::Plugin::UserSubroutine< S >::Register
 Class template Register registers the user function function pointer with the function_name on object creation. More...

Namespaces

namespace  sierra

Defines

#define FORTRAN_USER_SUBROUTINE(NAME, USER_SUB)   extern "C" const std::type_info * SIERRA_FORTRAN(NAME)() {return &typeid(USER_SUB::Signature);}

Typedefs

typedef std::type_info * type_info_func ()

Functions

std::string sierra::Plugin::derived_id_name (int derived_id)
stk::diag::Writersierra::Plugin::operator<< (stk::diag::Writer &dout, const Registry &registry)
void SIERRA_FORTRAN() register_user_subroutine (type_info_func type_id, void *user_subroutine, const char *name, int name_length)
 FORTRAN compatible user subprogram registration routine.

Detailed Description

Historically, the term User Subroutine has referred to Fortran subroutines which are generally called from within a procedure, allowing the user to create or select a mathematical calculation to be applied to set of arguments.

The purpose of this package is add User Plugins and User Functions as well as provide an analogous implementation of the traditional User Subroutine.

A User Plugin is a C++ class in which the application developer designs and implements a base class that end users can create or select derivative classes to before the desired operations.

A User Subroutine is a function with a specific calling signature allowing any registered subroutine with that signature to be called by its registered name.

A User Function is a functional calculation which accepts one or more independent const variables and returns a single dependent variable. These variables may be of scalar, vector or object quantities. These functions can be created or selected by the end user.

Definition in file UserPlugin.hpp.


Define Documentation

#define FORTRAN_USER_SUBROUTINE (   NAME,
  USER_SUB 
)    extern "C" const std::type_info * SIERRA_FORTRAN(NAME)() {return &typeid(USER_SUB::Signature);}

Macro FORTRAN_USER_SUBROUTINE generates a FortranFunctionTraits template specialization for the RETURN and SIGNATURE and creates a typedef referencing the user function factory of NAME.

Note that the user function has extern "C" linkage.

Parameters:
NAMEname to be used by the Fortran EXTERNAL statement
USER_SUBuser subroutine factory

Definition at line 683 of file UserPlugin.hpp.


Function Documentation

void SIERRA_FORTRAN() register_user_subroutine ( type_info_func  type_id,
void *  user_subroutine,
const char *  name,
int  name_length 
)

FORTRAN compatible user subprogram registration routine.

Description:
The first argument is for an application declared subprogram that provides an example interface. This example subprogram is used to "type" the user-subprogram, e.g. the caller of the registration routine guarantees that the interface of the 'user_sub' exactly matches the interface of the 'type_sub'.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines