Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
partons
core
numa
Commits
82f7b507
Commit
82f7b507
authored
Jun 29, 2016
by
Bryan Berthou
Browse files
refs#16
In NumA++ : - Implement Registry/Factory (as a draft) for Integrator.
parent
43542cc9
Changes
3
Hide whitespace changes
Inline
Side-by-side
include/NumA/integration/IntegratorFactory.h
0 → 100644
View file @
82f7b507
class
IntegratorFactory
{
};
include/NumA/integration/IntegratorRegistry.h
0 → 100644
View file @
82f7b507
#ifndef INTEGRATOR_REGISTRY_H
#define INTEGRATOR_REGISTRY_H
/**
* @file IntegratorRegistry.h
* @author Bryan BERTHOU (SPhN / CEA Saclay)
* @date June 29, 2016
* @version 1.0
*/
namespace
NumA
{
/**
* @class IntegratorRegistry
*
* @brief
*/
class
IntegratorRegistry
{
public:
/**
* Static function to be able to retrieve a unique instance pointer of this class anywhere in the code.
*
* @return a unique instance of this class
*/
static
IntegratorRegistry
*
getInstance
();
/**
* Default destructor
*/
virtual
~
IntegratorRegistry
();
unsigned
int
registerIntegrator
(
Integrator
*
pIntegrator
);
/**
* Try to find stored object identified by its unique class identifier.
*
* @param classId
* @return reference to object in memory or throw an exception
*/
Integrator
*
get
(
unsigned
int
classId
)
const
;
/**
* Try to find stored object identified by its class name.
*
* @param className
* @return reference to object in memory or throw an exception
*/
Integrator
*
get
(
const
std
::
string
&
className
)
const
;
private:
/**
* Private pointer of this class for a unique instance
*/
static
IntegratorRegistry
*
m_pInstance
;
/**
* Private default constructor for a unique instance
*/
IntegratorRegistry
();
std
::
map
<
unsigned
int
,
Integrator
*>
m_baseObjectList
;
///< list of registered objects identified by their unique integer identifier
std
::
map
<
std
::
string
,
Integrator
*>
m_translateList
;
///< list of registered objects identified by their class name.
};
}
// namespace NumA
#endif
/* INTEGRATOR_REGISTRY_H */
include/NumA/integration/one_dimension/Integrator.h
0 → 100644
View file @
82f7b507
class
Integrator
{
public:
Integrator
();
virtual
~
Integrator
();
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment