提交 3ca9e1d7 编写于 作者: L Liangliang Zhang 提交者: Jiangtao Hu

Perception: added object pool.

上级 309b76e7
......@@ -136,6 +136,14 @@ cc_test(
],
)
cc_library(
name = "frame",
hdrs = [
"frame.h",
"frame_supplement.h",
],
)
cc_library(
name = "object",
hdrs = [
......@@ -165,6 +173,16 @@ cc_test(
],
)
cc_library(
name = "object_pool",
hdrs = [
"object_pool.h",
"concurrent_object_pool.h",
],
deps = [
],
)
cc_library(
name = "omnidirectional_model",
hdrs = [
......@@ -242,6 +260,14 @@ cc_test(
],
)
cc_library(
name = "sensor_meta",
hdrs = [
"sensor_meta.h",
],
)
cc_library(
name = "syncedmem",
srcs = [
......
......@@ -15,11 +15,13 @@
*****************************************************************************/
#ifndef MODULES_PERCEPTION_BASE_CONCURRENT_OBJECT_POOL_H_
#define MODULES_PERCEPTION_BASE_CONCURRENT_OBJECT_POOL_H_
#include <deque>
#include <list>
#include <mutex>
#include <queue>
#include <vector>
#include "modules/perception/base/object_pool.h"
#define PERCEPTION_BASE_DISABLE_POOL
......@@ -50,6 +52,7 @@ class ConcurrentObjectPool : public BaseObjectPool<ObjectType> {
}
// @brief overrided function to get object smart pointer
ObjectTypePtr Get() override {
// TODO(All): remove conditional build
#ifndef PERCEPTION_BASE_DISABLE_POOL
ObjectType* ptr = nullptr;
{
......
......@@ -27,7 +27,9 @@ namespace base {
template <class ObjectType>
class BaseObjectPool {
public:
typedef std::shared_ptr<ObjectType> ObjectTypePtr;
// TODO(All): remove
// typedef std::shared_ptr<ObjectType> ObjectTypePtr;
// @brief default constructor
BaseObjectPool() = default;
// @brief default destructor
......
......@@ -15,6 +15,7 @@
*****************************************************************************/
#ifndef MODULES_PERCEPTION_BASE_OBJECT_POOL_TYPES_H_
#define MODULES_PERCEPTION_BASE_OBJECT_POOL_TYPES_H_
#include "modules/perception/base/concurrent_object_pool.h"
#include "modules/perception/base/frame.h"
#include "modules/perception/base/object.h"
......
......@@ -68,7 +68,8 @@ struct SensorInfo {
}
};
typedef std::shared_ptr<SensorInfo> SensorInfoPtr;
// TODO(All): remove
// typedef std::shared_ptr<SensorInfo> SensorInfoPtr;
} // namespace base
} // namespace perception
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册