tesseract v5.3.3.20231005
testing::DefaultValue< T > Class Template Reference

#include <gmock-actions.h>

Public Types

typedef T(* FactoryFunction) ()
 

Static Public Member Functions

static void Set (T x)
 
static void SetFactory (FactoryFunction factory)
 
static void Clear ()
 
static bool IsSet ()
 
static bool Exists ()
 
static T Get ()
 

Detailed Description

template<typename T>
class testing::DefaultValue< T >

Definition at line 287 of file gmock-actions.h.

Member Typedef Documentation

◆ FactoryFunction

template<typename T >
typedef T(* testing::DefaultValue< T >::FactoryFunction) ()

Definition at line 299 of file gmock-actions.h.

Member Function Documentation

◆ Clear()

template<typename T >
static void testing::DefaultValue< T >::Clear ( )
inlinestatic

Definition at line 306 of file gmock-actions.h.

306 {
307 delete producer_;
308 producer_ = nullptr;
309 }

◆ Exists()

template<typename T >
static bool testing::DefaultValue< T >::Exists ( )
inlinestatic

Definition at line 316 of file gmock-actions.h.

◆ Get()

template<typename T >
static T testing::DefaultValue< T >::Get ( )
inlinestatic

Definition at line 323 of file gmock-actions.h.

323 {
324 return producer_ == nullptr ? internal::BuiltInDefaultValue<T>::Get()
325 : producer_->Produce();
326 }

◆ IsSet()

template<typename T >
static bool testing::DefaultValue< T >::IsSet ( )
inlinestatic

Definition at line 312 of file gmock-actions.h.

312{ return producer_ != nullptr; }

◆ Set()

template<typename T >
static void testing::DefaultValue< T >::Set ( x)
inlinestatic

Definition at line 291 of file gmock-actions.h.

291 {
292 delete producer_;
293 producer_ = new FixedValueProducer(x);
294 }

◆ SetFactory()

template<typename T >
static void testing::DefaultValue< T >::SetFactory ( FactoryFunction  factory)
inlinestatic

Definition at line 300 of file gmock-actions.h.

300 {
301 delete producer_;
302 producer_ = new FactoryValueProducer(factory);
303 }

The documentation for this class was generated from the following file: