Some util functions.
More...
#include <algorithm>
#include <iostream>
#include <limits>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "cyber/common/log.h"
#include "cyber/common/types.h"
#include "modules/common/configs/config_gflags.h"
#include "modules/common/math/vec2d.h"
#include "modules/common/proto/geometry.pb.h"
#include "modules/common/proto/pnc_point.pb.h"
Go to the source code of this file.
|
template<typename ProtoA , typename ProtoB > |
bool | apollo::common::util::IsProtoEqual (const ProtoA &a, const ProtoB &b) |
|
template<typename T > |
bool | apollo::common::util::WithinBound (T start, T end, T value) |
|
PointENU | apollo::common::util::operator+ (const PointENU enu, const math::Vec2d &xy) |
|
template<typename T > |
void | apollo::common::util::uniform_slice (const T start, const T end, uint32_t num, std::vector< T > *sliced) |
|
template<typename U , typename V > |
double | apollo::common::util::DistanceXY (const U &u, const V &v) |
|
template<typename U , typename V > |
bool | apollo::common::util::SamePointXY (const U &u, const V &v) |
|
PathPoint | apollo::common::util::GetWeightedAverageOfTwoPathPoints (const PathPoint &p1, const PathPoint &p2, const double w1, const double w2) |
|
template<typename T > |
std::enable_if<!std::numeric_limits< T >::is_integer, bool >::type | apollo::common::util::IsFloatEqual (T x, T y, int ulp=2) |
|
template<typename T , size_t count> |
bool | ExcuteAllFunctions (T *obj, FunctionInfo< T > fun_list[]) |
|
template<typename A , typename B > |
std::ostream & | operator<< (std::ostream &os, std::pair< A, B > &p) |
|
◆ EXEC_ALL_FUNS
◆ UNIQUE_LOCK_MULTITHREAD
#define UNIQUE_LOCK_MULTITHREAD |
( |
|
mutex_type | ) |
|
Value:std::unique_ptr<std::unique_lock<std::mutex>> lock_ptr = nullptr; \
if (FLAGS_multithread_run) { \
lock_ptr.reset(new std::unique_lock<std::mutex>(mutex_type)); \
}
◆ ExcuteAllFunctions()
template<typename T , size_t count>
bool ExcuteAllFunctions |
( |
T * |
obj, |
|
|
FunctionInfo< T > |
fun_list[] |
|
) |
| |
◆ operator<<()
template<typename A , typename B >
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
std::pair< A, B > & |
p |
|
) |
| |