Apollo  6.0
Open source self driving car software
Classes | Namespaces | Macros | Functions
util.h File Reference

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"
Include dependency graph for util.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  apollo::common::util::PairHash
 
class  FunctionInfo< T >
 

Namespaces

 apollo::common::util
 apollo::common::util
 
 apollo
 PlanningContext is the runtime context in planning. It is persistent across multiple frames.
 
 apollo::common
 apollo::common
 

Macros

#define EXEC_ALL_FUNS(type, obj, list)   ExcuteAllFunctions<type, sizeof(list) / sizeof(FunctionInfo<type>)>(obj, list)
 
#define UNIQUE_LOCK_MULTITHREAD(mutex_type)
 

Functions

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)
 

Detailed Description

Some util functions.

Macro Definition Documentation

◆ EXEC_ALL_FUNS

#define EXEC_ALL_FUNS (   type,
  obj,
  list 
)    ExcuteAllFunctions<type, sizeof(list) / sizeof(FunctionInfo<type>)>(obj, list)

◆ 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)); \
}

Function Documentation

◆ 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 
)