InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
UnspecifiableOf< ValueType > Class Template Reference

#include <UnspecifiableOf.h>

Public Member Functions

 UnspecifiableOf (const Unspecified &)
 
 UnspecifiableOf (const ValueType &value)
 
 UnspecifiableOf (const UnspecifiableOf &other)
 
UnspecifiableOf< ValueType > & operator= (const UnspecifiableOf< ValueType > &other)
 
bool IsSpecified () const
 
ValueType GetValue () const
 

Detailed Description

template<class ValueType>
class UnspecifiableOf< ValueType >

UnspecifiableOf is a template that can be used to implement optional arguments to methods and functions. For example, if you have a method that takes a optional int argument, declare the type of the argument to be UnspecifiableOf<int>. Clients of the method can then pass an int or kUnspecified.

Constructor & Destructor Documentation

template<class ValueType>
UnspecifiableOf< ValueType >::UnspecifiableOf(const Unspecified)
inline

Constructor for unspecified case

Parameters
unspecified
template<class ValueType>
UnspecifiableOf< ValueType >::UnspecifiableOf(const ValueType & value)
inline

Constructor for specified case

Parameters
value
template<class ValueType>
UnspecifiableOf< ValueType >::UnspecifiableOf(const UnspecifiableOf< ValueType > & other)
inline

Copy constuctor

Parameters
otheris the object to copy

Member Function Documentation

template<class ValueType>
ValueType UnspecifiableOf< ValueType >::GetValue () const
inline

GetValue returns the value if specified

Returns
the value
template<class ValueType>
bool UnspecifiableOf< ValueType >::IsSpecified () const
inline

IsSpecified return true if the argument was specified otherwise false

Returns
whether specified
template<class ValueType>
UnspecifiableOf<ValueType>& UnspecifiableOf< ValueType >::operator= (const UnspecifiableOf< ValueType > & other)
inline

Assignment operator

Parameters
other,theobject to assign to this object