BALL
1.4.2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
include
BALL
CONCEPT
factory.h
Go to the documentation of this file.
1
// -*- Mode: C++; tab-width: 2; -*-
2
// vi: set ts=2:
3
//
4
5
#ifndef BALL_CONCEPT_FACTORY_H
6
#define BALL_CONCEPT_FACTORY_H
7
8
#ifndef BALL_COMMON_H
9
# include <
BALL/common.h
>
10
#endif
11
12
13
namespace
BALL
14
{
15
23
template
<
typename
T>
24
class
Factory
25
{
26
public
:
27
29
static
T*
create
() {
return
new
T; }
30
32
static
void
*
createVoid
() {
return
(
void
*)
new
T; }
33
35
static
const
T&
getDefault
()
36
{
37
static
T default_instance;
38
return
default_instance;
39
}
40
};
41
}
42
43
#endif // BALL_CONCEPT_FACTORY_H
Generated by
1.8.3.1