Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Pinoxchio
apollo
提交
b28a9479
A
apollo
项目概览
Pinoxchio
/
apollo
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
apollo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b28a9479
编写于
9月 28, 2018
作者:
G
GoLancer
提交者:
Liangliang Zhang
9月 28, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
framework: Fix record viewer issue
上级
f87fb78d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
19 addition
and
10 deletion
+19
-10
framework/cybertron/record/record_reader.cpp
framework/cybertron/record/record_reader.cpp
+5
-1
framework/cybertron/record/record_reader.h
framework/cybertron/record/record_reader.h
+0
-1
framework/cybertron/record/record_viewer.cpp
framework/cybertron/record/record_viewer.cpp
+1
-1
framework/cybertron/record/record_viewer.h
framework/cybertron/record/record_viewer.h
+1
-3
framework/cybertron/test/record/record_viewer_test.cpp
framework/cybertron/test/record/record_viewer_test.cpp
+12
-4
未找到文件。
framework/cybertron/record/record_reader.cpp
浏览文件 @
b28a9479
...
...
@@ -31,7 +31,11 @@ RecordReader::RecordReader(const std::string& file) {
}
}
void
RecordReader
::
Reset
()
{
file_reader_
->
Reset
();
}
void
RecordReader
::
Reset
()
{
file_reader_
->
Reset
();
message_index_
=
0
;
chunk_
=
ChunkBody
();
}
const
Header
&
RecordReader
::
header
()
const
{
return
header_
;
}
...
...
framework/cybertron/record/record_reader.h
浏览文件 @
b28a9479
...
...
@@ -51,7 +51,6 @@ class RecordReader : public RecordBase {
bool
ReadNextChunk
(
ChunkBody
*
chunk
,
uint64_t
begin_time
,
uint64_t
end_time
);
proto
::
ChunkBody
chunk_
;
proto
::
Index
index_
;
uint64_t
pos
=
0
;
uint32_t
message_index_
=
0
;
std
::
unique_ptr
<
RecordFileReader
>
file_reader_
;
};
...
...
framework/cybertron/record/record_viewer.cpp
浏览文件 @
b28a9479
...
...
@@ -90,7 +90,7 @@ bool RecordViewer::Iterator::operator==(Iterator const& other) const {
if
(
other
.
end_
)
{
return
end_
;
}
return
index_
==
other
.
index_
;
return
index_
==
other
.
index_
&&
viewer_
==
other
.
viewer_
;
}
bool
RecordViewer
::
Iterator
::
operator
!=
(
const
Iterator
&
rhs
)
const
{
...
...
framework/cybertron/record/record_viewer.h
浏览文件 @
b28a9479
...
...
@@ -50,21 +50,19 @@ class RecordViewer {
Iterator
()
{}
virtual
~
Iterator
()
{}
private:
friend
class
RecordViewer
;
bool
operator
==
(
Iterator
const
&
other
)
const
;
bool
operator
!=
(
const
Iterator
&
rhs
)
const
;
void
operator
++
();
pointer
operator
->
();
reference
operator
*
();
private:
bool
end_
=
false
;
uint64_t
index_
=
0
;
RecordViewer
*
viewer_
=
nullptr
;
value_type
message_instance_
;
};
public:
Iterator
begin
();
Iterator
end
();
...
...
framework/cybertron/test/record/record_viewer_test.cpp
浏览文件 @
b28a9479
...
...
@@ -107,16 +107,19 @@ TEST(RecordTest, filter_test) {
RecordViewer
viewer_0
(
reader
);
EXPECT_EQ
(
CheckCount
(
viewer_0
),
1000
);
EXPECT_EQ
(
START_TIME
,
viewer_0
.
get_
begin_time
());
EXPECT_EQ
(
END_TIME
-
1
,
viewer_0
.
get_
end_time
());
EXPECT_EQ
(
START_TIME
,
viewer_0
.
begin_time
());
EXPECT_EQ
(
END_TIME
-
1
,
viewer_0
.
end_time
());
RecordViewer
viewer_1
(
reader
,
END_TIME
,
END_TIME
);
EXPECT_EQ
(
CheckCount
(
viewer_1
),
0
);
EXPECT_EQ
(
END_TIME
,
viewer_1
.
get_
begin_time
());
EXPECT_EQ
(
END_TIME
,
viewer_1
.
begin_time
());
RecordViewer
viewer_2
(
reader
,
END_TIME
,
START_TIME
);
EXPECT_EQ
(
CheckCount
(
viewer_2
),
0
);
EXPECT_EQ
(
START_TIME
,
viewer_2
.
get_end_time
());
EXPECT_EQ
(
START_TIME
,
viewer_2
.
end_time
());
viewer_0
.
begin
();
viewer_0
.
begin
();
RecordViewer
viewer_3
(
reader
,
0
,
END_TIME
);
EXPECT_EQ
(
CheckCount
(
viewer_3
),
1000
);
...
...
@@ -124,6 +127,10 @@ TEST(RecordTest, filter_test) {
RecordViewer
viewer_4
(
reader
,
START_TIME
);
EXPECT_EQ
(
CheckCount
(
viewer_4
),
1000
);
auto
it_1
=
viewer_3
.
begin
();
auto
it_2
=
viewer_4
.
begin
();
EXPECT_FALSE
(
it_1
==
it_2
);
RecordViewer
viewer_5
(
reader
,
1500
,
1600
);
EXPECT_EQ
(
CheckCount
(
viewer_5
),
101
);
...
...
@@ -132,6 +139,7 @@ TEST(RecordTest, filter_test) {
RecordViewer
viewer_7
(
reader
,
0
,
END_TIME
,
{
CHANNEL_NAME_1
});
EXPECT_EQ
(
CheckCount
(
viewer_7
),
1000
);
}
}
// namespace record
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录