LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | List of all members
lsst::afw::table::FieldBase< std::string > Struct Template Reference

Field base class specialization for strings. More...

#include <FieldBase.h>

Inheritance diagram for lsst::afw::table::FieldBase< std::string >:
lsst::afw::table::Key< std::string >

Public Types

typedef std::string Value
 the type returned by BaseRecord::get More...
 
typedef char * Reference
 the type returned by BaseRecord::operator[] More...
 
typedef char const * ConstReference
 the type returned by BaseRecord::operator[] (const) More...
 
typedef char Element
 the type of subfields and array elements More...
 

Public Member Functions

 FieldBase (int size=-1)
 Construct a FieldBase with the given size. More...
 
int getElementCount () const
 Return the number of subfield elements (equal to the size of the string, including a null terminator). More...
 
int getSize () const
 Return the maximum length of the string, including a null terminator (equal to the number of subfield elements). More...
 

Static Public Member Functions

static std::string getTypeString ()
 Return a string description of the field type. More...
 

Protected Member Functions

void stream (std::ostream &os) const
 Defines how Fields are printed. More...
 
Reference getReference (Element *p, ndarray::Manager::Ptr const &m) const
 Used to implement RecordBase::operator[] (non-const). More...
 
ConstReference getConstReference (Element const *p, ndarray::Manager::Ptr const &m) const
 Used to implement RecordBase::operator[] (const). More...
 
Value getValue (Element const *p, ndarray::Manager::Ptr const &m) const
 Used to implement RecordBase::get. More...
 
void setValue (Element *p, ndarray::Manager::Ptr const &, std::string const &value) const
 Used to implement RecordBase::set. More...
 

Static Protected Member Functions

static FieldBase makeDefault ()
 Needed to allow Keys to be default-constructed. More...
 

Private Attributes

int _size
 

Detailed Description

template<>
struct lsst::afw::table::FieldBase< std::string >

Field base class specialization for strings.

Definition at line 230 of file FieldBase.h.

Member Typedef Documentation

typedef char const* lsst::afw::table::FieldBase< std::string >::ConstReference

the type returned by BaseRecord::operator[] (const)

Definition at line 238 of file FieldBase.h.

typedef char lsst::afw::table::FieldBase< std::string >::Element

the type of subfields and array elements

Definition at line 240 of file FieldBase.h.

typedef char* lsst::afw::table::FieldBase< std::string >::Reference

the type returned by BaseRecord::operator[]

Definition at line 235 of file FieldBase.h.

typedef std::string lsst::afw::table::FieldBase< std::string >::Value

the type returned by BaseRecord::get

Definition at line 232 of file FieldBase.h.

Constructor & Destructor Documentation

lsst::afw::table::FieldBase< std::string >::FieldBase ( int  size = -1)

Construct a FieldBase with the given size.

This constructor is implicit and has an invalid default so it can be used in the Field constructor (as if it were an int argument) without specializing Field. In other words, it allows one to construct a 25-character string field like this:

* Field< std::string >("name", "documentation", 25);
*

...even though the third argument to the Field constructor takes a FieldBase, not an int.

Member Function Documentation

ConstReference lsst::afw::table::FieldBase< std::string >::getConstReference ( Element const *  p,
ndarray::Manager::Ptr const &  m 
) const
inlineprotected

Used to implement RecordBase::operator[] (const).

Definition at line 280 of file FieldBase.h.

280  {
281  return p;
282  }
int lsst::afw::table::FieldBase< std::string >::getElementCount ( ) const
inline

Return the number of subfield elements (equal to the size of the string, including a null terminator).

Definition at line 260 of file FieldBase.h.

Reference lsst::afw::table::FieldBase< std::string >::getReference ( Element p,
ndarray::Manager::Ptr const &  m 
) const
inlineprotected

Used to implement RecordBase::operator[] (non-const).

Definition at line 275 of file FieldBase.h.

275  {
276  return p;
277  }
int lsst::afw::table::FieldBase< std::string >::getSize ( ) const
inline

Return the maximum length of the string, including a null terminator (equal to the number of subfield elements).

Definition at line 264 of file FieldBase.h.

static std::string lsst::afw::table::FieldBase< std::string >::getTypeString ( )
static

Return a string description of the field type.

Value lsst::afw::table::FieldBase< std::string >::getValue ( Element const *  p,
ndarray::Manager::Ptr const &  m 
) const
protected

Used to implement RecordBase::get.

static FieldBase lsst::afw::table::FieldBase< std::string >::makeDefault ( )
inlinestaticprotected

Needed to allow Keys to be default-constructed.

Definition at line 269 of file FieldBase.h.

269 { return FieldBase(0); }
FieldBase(int size=-1)
Construct a FieldBase with the given size.
void lsst::afw::table::FieldBase< std::string >::setValue ( Element p,
ndarray::Manager::Ptr const &  ,
std::string const &  value 
) const
protected

Used to implement RecordBase::set.

void lsst::afw::table::FieldBase< std::string >::stream ( std::ostream &  os) const
inlineprotected

Defines how Fields are printed.

Definition at line 272 of file FieldBase.h.

272 { os << ", size=" << _size; }

Member Data Documentation

int lsst::afw::table::FieldBase< std::string >::_size
private

Definition at line 291 of file FieldBase.h.


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