Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
common
post-processing-filters-list.h
Go to the documentation of this file.
1
// License: Apache 2.0. See LICENSE file in root directory.
2
// Copyright(c) 2019 Intel Corporation. All Rights Reserved.
3
4
#pragma once
5
6
#include "
post-processing-filter.h
"
7
#include <list>
8
#include <memory>
9
10
11
/*
12
Container for all the filters that are defined. These are added into our list and can be iterated
13
over, without actual knowledge of any implementation.
14
*/
15
struct
post_processing_filters_list
16
{
17
typedef
std::function<
18
std::shared_ptr< post_processing_filter >()
19
>
create_fn
;
20
typedef
std::list< create_fn >
list
;
21
22
static
list &
get
()
23
{
24
static
list the_filters;
25
return
the_filters;
26
}
27
28
template
<
class
T >
29
static
list::iterator
register_filter
(
std::string
const
&
name
)
30
{
31
auto
&
filters
=
get
();
32
return
filters
.insert(
33
filters
.end(),
34
[
name
]() -> std::shared_ptr< post_processing_filter >
35
{
36
try
37
{
38
return
std::make_shared< T >(
name
);
39
}
40
catch
( std::exception
const
&
e
)
41
{
42
LOG_ERROR
(
"Failed to start "
<< name <<
": "
<< e.what());
43
}
44
catch
( ... )
45
{
46
LOG_ERROR
(
"Failed to start "
<< name <<
": unknown exception"
);
47
}
48
return
std::shared_ptr< T >();
49
}
50
);
51
}
52
};
53
name
GLuint const GLchar * name
Definition:
glad/glad/glad.h:2778
post_processing_filters_list
Definition:
post-processing-filters-list.h:15
post-processing-filter.h
string
GLsizei const GLchar *const * string
Definition:
glad/glad/glad.h:2862
post_processing_filters_list::register_filter
static list::iterator register_filter(std::string const &name)
Definition:
post-processing-filters-list.h:29
rmse.e
e
Definition:
rmse.py:177
post_processing_filters_list::list
std::list< create_fn > list
Definition:
post-processing-filters-list.h:20
pyglet_pointcloud_viewer.filters
list filters
Definition:
pyglet_pointcloud_viewer.py:111
post_processing_filters_list::create_fn
std::function< std::shared_ptr< post_processing_filter >) > create_fn
Definition:
post-processing-filters-list.h:19
LOG_ERROR
#define LOG_ERROR(...)
Definition:
src/types.h:242
librealsense2
Author(s): Sergey Dorodnicov
, Doron Hirshberg
, Mark Horn
, Reagan Lopez
, Itay Carpis
autogenerated on Mon May 3 2021 02:47:39