Cantera
2.5.1
include
cantera
thermo
PDSSFactory.h
Go to the documentation of this file.
1
//! @file PDSSFactory.h
2
3
// This file is part of Cantera. See License.txt in the top-level directory or
4
// at https://cantera.org/license.txt for license and copyright information.
5
6
#ifndef PDSS_FACTORY_H
7
#define PDSS_FACTORY_H
8
9
#include "
PDSS.h
"
10
#include "
cantera/base/FactoryBase.h
"
11
#include "
cantera/thermo/VPStandardStateTP.h
"
12
13
namespace
Cantera
14
{
15
16
class
PDSSFactory :
public
Factory<PDSS>
17
{
18
public
:
19
//! Static function that creates a static instance of the factory.
20
static
PDSSFactory* factory() {
21
std::unique_lock<std::mutex> lock(thermo_mutex);
22
if
(!s_factory) {
23
s_factory =
new
PDSSFactory;
24
}
25
return
s_factory;
26
}
27
28
//! delete the static instance of this factory
29
virtual
void
deleteFactory() {
30
std::unique_lock<std::mutex> lock(thermo_mutex);
31
delete
s_factory;
32
s_factory = 0;
33
}
34
35
//! Create a new thermodynamic property manager.
36
/*!
37
* @param model String to look up the model against
38
* @returns a pointer to a new PDSS instance matching the model string.
39
* Returns NULL if something went wrong. Throws an exception if the string
40
* wasn't matched.
41
*/
42
virtual
PDSS* newPDSS(
const
std::string& model);
43
44
private
:
45
//! static member of a single instance
46
static
PDSSFactory* s_factory;
47
48
//! Private constructors prevents usage
49
PDSSFactory();
50
51
//! Decl for locking mutex for thermo factory singleton
52
static
std::mutex thermo_mutex;
53
};
54
55
PDSS* newPDSS(
const
std::string& model);
56
57
}
58
59
#endif
VPStandardStateTP.h
PDSS.h
FactoryBase.h
Cantera
Namespace for the Cantera kernel.
Definition:
AnyMap.cpp:263
Generated by
1.8.17