Reformatted data_log.
BUG= Review URL: https://webrtc-codereview.appspot.com/974007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@3221 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
c94f8d4e8f
commit
ba21c95e15
@ -8,34 +8,32 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
// This singleton can be used for logging data for offline processing. Data
|
||||||
* This singleton can be used for logging data for offline processing. Data
|
// logged with it can conveniently be parsed and processed with e.g. Matlab.
|
||||||
* logged with it can conveniently be parsed and processed with e.g. Matlab.
|
//
|
||||||
*
|
// Following is an example of the log file format, starting with the header
|
||||||
* Following is an example of the log file format, starting with the header
|
// row at line 1, and the data rows following.
|
||||||
* row at line 1, and the data rows following.
|
// col1,col2,col3,multi-value-col4[3],,,col5
|
||||||
* col1,col2,col3,multi-value-col4[3],,,col5
|
// 123,10.2,-243,1,2,3,100
|
||||||
* 123,10.2,-243,1,2,3,100
|
// 241,12.3,233,1,2,3,200
|
||||||
* 241,12.3,233,1,2,3,200
|
// 13,16.4,-13,1,2,3,300
|
||||||
* 13,16.4,-13,1,2,3,300
|
//
|
||||||
*
|
// As can be seen in the example, a multi-value-column is specified with the
|
||||||
* As can be seen in the example, a multi-value-column is specified with the
|
// name followed the number of elements it contains. This followed by
|
||||||
* name followed the number of elements it contains. This followed by
|
// number of elements - 1 empty columns.
|
||||||
* number of elements - 1 empty columns.
|
//
|
||||||
*
|
// Without multi-value-columns this format can be natively by Matlab. With
|
||||||
* Without multi-value-columns this format can be natively by Matlab. With
|
// multi-value-columns a small Matlab script is needed, available at
|
||||||
* multi-value-columns a small Matlab script is needed, available at
|
// trunk/tools/matlab/parseLog.m.
|
||||||
* trunk/tools/matlab/parseLog.m.
|
//
|
||||||
*
|
// Table names and column names are case sensitive.
|
||||||
* Table names and column names are case sensitive.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_H_
|
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_H_
|
||||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_H_
|
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_H_
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "data_log_impl.h"
|
#include "webrtc/system_wrappers/interface/data_log_impl.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
|
@ -8,27 +8,23 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
// This is a pure C wrapper of the DataLog class. The functions are directly
|
||||||
* This is a pure C wrapper of the DataLog class. The functions are directly
|
// mapped here except for InsertCell as C does not support templates.
|
||||||
* mapped here except for InsertCell as C does not support templates.
|
// See data_log.h for a description of the functions.
|
||||||
* See data_log.h for a description of the functions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef SRC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_C_H_
|
#ifndef SRC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_C_H_
|
||||||
#define SRC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_C_H_
|
#define SRC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_C_H_
|
||||||
|
|
||||||
#include <stddef.h> /* size_t */
|
#include <stddef.h> // size_t
|
||||||
|
|
||||||
#include "typedefs.h" /* NOLINT(build/include) */
|
#include "webrtc/typedefs.h" // NOLINT(build/include)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
// All char* parameters in this file are expected to be null-terminated
|
||||||
* All char* parameters in this file are expected to be null-terminated
|
// character sequences.
|
||||||
* character sequences.
|
|
||||||
*/
|
|
||||||
int WebRtcDataLog_CreateLog();
|
int WebRtcDataLog_CreateLog();
|
||||||
void WebRtcDataLog_ReturnLog();
|
void WebRtcDataLog_ReturnLog();
|
||||||
char* WebRtcDataLog_Combine(char* combined_name, size_t combined_len,
|
char* WebRtcDataLog_Combine(char* combined_name, size_t combined_len,
|
||||||
@ -83,7 +79,7 @@ int WebRtcDataLog_InsertArray_int64(const char* table_name,
|
|||||||
int WebRtcDataLog_NextRow(const char* table_name);
|
int WebRtcDataLog_NextRow(const char* table_name);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* end of extern "C" */
|
} // end of extern "C"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /* SRC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_C_H_ */ /* NOLINT */
|
#endif // SRC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_C_H_ // NOLINT
|
||||||
|
@ -8,14 +8,12 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
// This file contains the helper classes for the DataLog APIs. See data_log.h
|
||||||
* This file contains the helper classes for the DataLog APIs. See data_log.h
|
// for the APIs.
|
||||||
* for the APIs.
|
//
|
||||||
*
|
// These classes are helper classes used for logging data for offline
|
||||||
* These classes are helper classes used for logging data for offline
|
// processing. Data logged with these classes can conveniently be parsed and
|
||||||
* processing. Data logged with these classes can conveniently be parsed and
|
// processed with e.g. Matlab.
|
||||||
* processed with e.g. Matlab.
|
|
||||||
*/
|
|
||||||
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_IMPL_H_
|
#ifndef WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_IMPL_H_
|
||||||
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_IMPL_H_
|
#define WEBRTC_SYSTEM_WRAPPERS_INTERFACE_DATA_LOG_IMPL_H_
|
||||||
|
|
||||||
@ -24,8 +22,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "scoped_ptr.h"
|
#include "webrtc/system_wrappers/interface/scoped_ptr.h"
|
||||||
#include "typedefs.h"
|
#include "webrtc/typedefs.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
|
@ -8,18 +8,17 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "data_log.h"
|
#include "webrtc/system_wrappers/interface/data_log.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
||||||
#include "critical_section_wrapper.h"
|
#include "webrtc/system_wrappers/interface/critical_section_wrapper.h"
|
||||||
#include "event_wrapper.h"
|
#include "webrtc/system_wrappers/interface/event_wrapper.h"
|
||||||
#include "file_wrapper.h"
|
#include "webrtc/system_wrappers/interface/file_wrapper.h"
|
||||||
#include "rw_lock_wrapper.h"
|
#include "webrtc/system_wrappers/interface/rw_lock_wrapper.h"
|
||||||
#include "thread_wrapper.h"
|
#include "webrtc/system_wrappers/interface/thread_wrapper.h"
|
||||||
|
|
||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
|
|
||||||
|
@ -8,15 +8,13 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
// This is the pure C wrapper of the DataLog class.
|
||||||
* This is the pure C wrapper of the DataLog class.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "system_wrappers/interface/data_log_c.h"
|
#include "webrtc/system_wrappers/interface/data_log_c.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "system_wrappers/interface/data_log.h"
|
#include "webrtc/system_wrappers/interface/data_log.h"
|
||||||
|
|
||||||
extern "C" int WebRtcDataLog_CreateLog() {
|
extern "C" int WebRtcDataLog_CreateLog() {
|
||||||
return webrtc::DataLog::CreateLog();
|
return webrtc::DataLog::CreateLog();
|
||||||
|
@ -8,13 +8,13 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "system_wrappers/source/data_log_c_helpers_unittest.h"
|
#include "webrtc/system_wrappers/source/data_log_c_helpers_unittest.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include "system_wrappers/interface/data_log_c.h"
|
#include "webrtc/system_wrappers/interface/data_log_c.h"
|
||||||
|
|
||||||
enum { kTestArrayLen = 4 };
|
enum { kTestArrayLen = 4 };
|
||||||
static const char kTableName[] = "c_wrapper_table";
|
static const char kTableName[] = "c_wrapper_table";
|
||||||
@ -31,7 +31,7 @@ int WebRtcDataLogCHelper_TestReturnLog() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int WebRtcDataLogCHelper_TestCombine() {
|
int WebRtcDataLogCHelper_TestCombine() {
|
||||||
const int kOutLen = strlen(kTableName) + 4; /* Room for "_17" + '\0' */
|
const int kOutLen = strlen(kTableName) + 4; // Room for "_17" + '\0'
|
||||||
char* combined_name = malloc(kOutLen * sizeof(char));
|
char* combined_name = malloc(kOutLen * sizeof(char));
|
||||||
char* out_ptr = WebRtcDataLog_Combine(combined_name, kOutLen, kTableName, 17);
|
char* out_ptr = WebRtcDataLog_Combine(combined_name, kOutLen, kTableName, 17);
|
||||||
int return_code = 0;
|
int return_code = 0;
|
||||||
|
@ -8,9 +8,10 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "webrtc/system_wrappers/interface/data_log.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "data_log.h"
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
using ::webrtc::DataLog;
|
using ::webrtc::DataLog;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "data_log.h"
|
#include "webrtc/system_wrappers/interface/data_log.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -8,13 +8,14 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "webrtc/system_wrappers/interface/data_log.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "system_wrappers/interface/data_log.h"
|
|
||||||
#include "system_wrappers/interface/data_log_c.h"
|
|
||||||
#include "system_wrappers/source/data_log_c_helpers_unittest.h"
|
|
||||||
#include "gtest/gtest.h"
|
#include "gtest/gtest.h"
|
||||||
|
#include "webrtc/system_wrappers/interface/data_log_c.h"
|
||||||
|
#include "webrtc/system_wrappers/source/data_log_c_helpers_unittest.h"
|
||||||
|
|
||||||
using ::webrtc::DataLog;
|
using ::webrtc::DataLog;
|
||||||
|
|
||||||
@ -257,9 +258,9 @@ TEST(TestDataLog, VerifyMultipleTables) {
|
|||||||
kNumberOfRows),
|
kNumberOfRows),
|
||||||
1);
|
1);
|
||||||
expected["timestamp,"] = ExpectedValues(
|
expected["timestamp,"] = ExpectedValues(
|
||||||
std::vector<std::string>(string_timestamp,
|
std::vector<std::string>(string_timestamp,
|
||||||
string_timestamp +
|
string_timestamp +
|
||||||
kNumberOfRows),
|
kNumberOfRows),
|
||||||
1);
|
1);
|
||||||
ASSERT_EQ(DataLogParser::VerifyTable(table, expected), 0);
|
ASSERT_EQ(DataLogParser::VerifyTable(table, expected), 0);
|
||||||
fclose(table);
|
fclose(table);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* be found in the AUTHORS file in the root of the source tree.
|
* be found in the AUTHORS file in the root of the source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "system_wrappers/interface/data_log.h"
|
#include "webrtc/system_wrappers/interface/data_log.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user