1 //
2 // This file is part of the SDTS++ toolkit, written by the U.S.
3 // Geological Survey.  It is experimental software, written to support
4 // USGS research and cartographic data production.
5 //
6 // SDTS++ is public domain software.  It may be freely copied,
7 // distributed, and modified.  The USGS welcomes user feedback, but makes
8 // no committment to any level of support for this code.  See the SDTS
9 // web site at http://mcmcweb.er.usgs.gov/sdts for more information,
10 // including points of contact.
11 //
12 // sc_Field.h: interface for the sc_Field class.
13 //
14 // $Id: sc_Field.h,v 1.9 2003/01/03 20:41:05 mcoletti Exp $
15 //
16 
17 #ifndef INCLUDED_SC_FIELD_H
18 #define INCLUDED_SC_FIELD_H
19 
20 
21 #ifdef _MSC_VER
22 #pragma warning( disable : 4786 )
23 #endif
24 
25 #include <iostream>
26 #include <list>
27 
28 
29 #ifndef INCLUDED_SC_SUBFIELD_H
30 #include <sdts++/container/sc_Subfield.h>
31 #endif
32 
33 
34 /// Canonical container type for subfields.
35 typedef std::list<sc_Subfield> sc_SubfieldCntr;
36 
37 
38 /**
39   SDTS logical field
40 */
41 class sc_Field : public sc_SubfieldCntr
42 {
43    public:
44 
45       ///
46       typedef sc_SubfieldCntr::iterator iterator;
47 
48       ///
49       typedef sc_SubfieldCntr::const_iterator const_iterator;
50 
51 
52       /// default ctor needed for STL
sc_Field()53       sc_Field() {}
54 
55       ///
56       sc_Field( std::string const& name, std::string const& mnemonic );
57 
58       /// Returns the SDTS Name of this field (if one has been set).
59       std::string const& getName() const;
name()60       std::string const& name() const { return getName(); }
61 
62       /// Returns the SDTS Mnemonic of this field (if one has been set).
63       std::string const& getMnemonic() const;
mnemonic()64       std::string const& mnemonic() const { return getMnemonic(); }
65 
66       ///
67       std::string const& setName( std::string const& name );
name(std::string const & name)68       std::string const& name( std::string const& name )
69       { return setName( name ); }
70 
71       ///
72       std::string const& setMnemonic( std::string const& mnemonic );
mnemonic(std::string const & mnemonic)73       std::string const& mnemonic( std::string const& mnemonic )
74       { return setMnemonic( mnemonic ); }
75 
76    private:
77 
78       /// SDTS Field Name
79       std::string name_;
80 
81       /// SDTS Field Mnemonic
82       std::string mnemonic_;
83 
84       friend std::ostream& operator<<( std::ostream&, sc_Field const& );
85 
86 }; // class sc_Field
87 
88 #endif
89