Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
google::protobuf::util Namespace Reference

Functions

template<typename T >
void Truncate (RepeatedPtrField< T > *array, int new_size)
 RepeatedPtrField version.
 
template<typename T >
void Truncate (RepeatedField< T > *array, int new_size)
 RepeatedField version.
 
template<typename RepeatedType , typename IndexContainer = std::vector<int>>
int RemoveAt (RepeatedType *array, const IndexContainer &indices)
 
template<typename T >
ParseTextOrDie (const std::string &input)
 

Function Documentation

◆ ParseTextOrDie()

template<typename T >
T google::protobuf::util::ParseTextOrDie ( const std::string & input)

Definition at line 77 of file protobuf_util.h.

◆ RemoveAt()

template<typename RepeatedType , typename IndexContainer = std::vector<int>>
int google::protobuf::util::RemoveAt ( RepeatedType * array,
const IndexContainer & indices )

Removes the elements at the indices specified by 'indices' from 'array' in time linear in the size of 'array' (on average, even when 'indices' is a singleton) while preserving the relative order of the remaining elements. The indices must be a container of ints in strictly increasing order, such as vector<int>, set<int> or initializer_list<int>, and in the range [0, N - 1] where N is the number of elements in 'array', and RepeatedType must be RepeatedField or RepeatedPtrField. Returns number of elements erased.

Assumes that 'indices' consists of [0 ... N-1].

Definition at line 50 of file protobuf_util.h.

◆ Truncate() [1/2]

template<typename T >
void google::protobuf::util::Truncate ( RepeatedField< T > * array,
int new_size )
inline

RepeatedField version.

RepeatedField::Truncate performs size validity checks.

Definition at line 36 of file protobuf_util.h.

◆ Truncate() [2/2]

template<typename T >
void google::protobuf::util::Truncate ( RepeatedPtrField< T > * array,
int new_size )
inline

RepeatedPtrField version.

Definition at line 28 of file protobuf_util.h.