Electroneum
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 200 of file gmock-actions.h.

Member Typedef Documentation

◆ FactoryFunction

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

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

Member Function Documentation

◆ Clear()

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

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

219  {
220  delete producer_;
221  producer_ = NULL;
222  }

◆ Exists()

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

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

Here is the call graph for this function:

◆ Get()

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

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

236  {
237  return producer_ == NULL ?
238  internal::BuiltInDefaultValue<T>::Get() : producer_->Produce();
239  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsSet()

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

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

225 { return producer_ != NULL; }
Here is the caller graph for this function:

◆ Set()

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

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

204  {
205  delete producer_;
206  producer_ = new FixedValueProducer(x);
207  }

◆ SetFactory()

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

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

213  {
214  delete producer_;
215  producer_ = new FactoryValueProducer(factory);
216  }

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