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 
13 #ifndef INCLUDED_SB_IDEN_H
14 #define INCLUDED_SB_IDEN_H
15 
16 // $Id: sb_Iden.h,v 1.9 2002/11/24 22:07:42 mcoletti Exp $
17 
18 #include <string>
19 
20 #ifndef SB_MODULE_H
21 #include <sdts++/builder/sb_Module.h>
22 #endif
23 
24 
25 #ifndef INCLUDED_SIO8211FIELDFORMAT_H
26 #include <sdts++/io/sio_8211FieldFormat.h>
27 #endif
28 
29 
30 //class  sb_ForeignID;
31 struct sb_Iden_Imp;
32 class  sc_Record;
33 
34 
35 /**
36  This class provides a convenient access to IDEN records.  It provides
37  members to access or set various module field and subfield values.
38  It also provides a mechanism for populating an object of this class with
39  values found in a valid sc_Record of this module, and for filling a
40  sc_Record with the contents of a sb_Iden object.
41 */
42 class sb_Iden : public sb_Module
43 {
44    public:
45 
46       sb_Iden();
47 
48       ~sb_Iden();
49 
50       sb_Iden(sc_Record const & recprox);
51 
52       /**
53        Use these members to get subfield/field values.  Pass in an appropriate
54        type to receive the value.  These members will return false if the
55        corresponding value is not set.  (It may not be set because a value
56        was not assigned to it, or because you previously tried to assign
57        an invalid value.)  Otherwise they will return true.
58       */
59       bool getStandardIdentification( std::string& str ) const;
getSTID(std::string & str)60       bool getSTID( std::string& str ) const { return getStandardIdentification( str ); }
61 
62       bool getStandardVersion( std::string& str ) const;
getSTVS(std::string & str)63       bool getSTVS( std::string& str ) const { return getStandardVersion( str ); }
64 
65       bool getStandardDocumentationReference( std::string& str ) const;
getDOCU(std::string & str)66       bool getDOCU( std::string& str ) const
67       { return getStandardDocumentationReference( str ); }
68 
69       bool getProfileIdentification( std::string& str ) const;
getPRID(std::string & str)70       bool getPRID( std::string& str ) const { return getProfileIdentification( str ); }
71 
72       bool getProfileVersion( std::string& str ) const;
getPRVS(std::string & str)73       bool getPRVS( std::string& str ) const { return getProfileVersion( str ); }
74 
75       bool getProfileDocumentationReference( std::string& str ) const;
getPDOC(std::string & str)76       bool getPDOC( std::string& str ) const
77       { return getProfileDocumentationReference( str ); }
78 
79       bool getTitle( std::string& str ) const;
getTITL(std::string & str)80       bool getTITL( std::string& str ) const { return getTitle( str ); }
81 
82       bool getDataID( std::string& str ) const;
getDAID(std::string & str)83       bool getDAID( std::string& str ) const { return getDataID( str ); }
84 
85       bool getDataStructure( std::string& str ) const;
getDAST(std::string & str)86       bool getDAST( std::string& str ) const { return getDataStructure( str ); }
87 
88       bool getMapDate( std::string& str ) const;
getMPDT(std::string & str)89       bool getMPDT( std::string& str ) const { return getMapDate( str ); }
90 
91       bool getDataSetCreationDate( std::string& str ) const;
getDCDT(std::string & str)92       bool getDCDT( std::string& str ) const { return getDataSetCreationDate( str ); }
93 
94       bool getScale( long& val ) const;
getSCAL(long & val)95       bool getSCAL( long& val ) const { return getScale( val ); }
96 
97       bool getComment( std::string& str ) const;
getCOMT(std::string & str)98       bool getCOMT( std::string& str ) const { return getComment( str ); }
99 
100 
101       //  Conformance field
102 
103       bool getComposites( std::string& str ) const;
getFFYN(std::string & str)104       bool getFFYN( std::string& str ) const { return getComposites( str ); }
105 
106       bool getVectorGeometry( std::string& str ) const;
getVGYN(std::string & str)107       bool getVGYN( std::string& str ) const { return getVectorGeometry( str ); }
108 
109       bool getVectorTopology( std::string& str ) const;
getGTYN(std::string & str)110       bool getGTYN( std::string& str ) const { return getVectorTopology( str ); }
111 
112       bool getRaster( std::string& str ) const;
getRCYN(std::string & str)113       bool getRCYN( std::string& str ) const { return getRaster( str ); }
114 
115       bool getExternalSpatialReference( long& val ) const;
getEXSP(long & val)116       bool getEXSP( long& val ) const { return getExternalSpatialReference( val ); }
117 
118       bool getFeaturesLevel( long& val ) const;
getFTLV(long & val)119       bool getFTLV( long& val ) const { return getFeaturesLevel( val ); }
120 
121       bool getCodingLevel( long& val ) const;
getCDLV(long & val)122       bool getCDLV( long& val ) const { return getCodingLevel( val ); }
123 
124       bool getNonGeoSpatialDimensions( std::string& str ) const;
getNGDM(std::string & str)125       bool getNGDM( std::string& str ) const
126       { return getNonGeoSpatialDimensions( str ); }
127 
128 
129       // Attribute
130 
131 #ifdef NOT_IMPLEMENTED
132       bool getAttributeID( sb_ForeignID& fid ) const;
getATID(sb_ForeignID & fid)133       bool getATID( sb_ForeignID& fid ) const { return getAttributeID( fid ); }
134 #endif
135 
136       /**
137        fill the given record based on the builder's object field/subfield
138        values -- return false if in a wedged state. (E.g., a mandatory
139        field isn't set or was assigned a value outside it's proper
140        domain.
141       */
142       bool getRecord( sc_Record& record ) const;
143 
144 
145       /**
146        Use these members to set subfield/field values.  Pass in an appropriate
147        value for the particular subfield/field to be set to.  They will return
148        false if you try to assign a value outside the domain of the given
149        subfield/field.  (Note that this is not too pedantic; for example, we
150        do not check to see if a conditionally mandatory or optional field has
151        been set.)
152       */
153       void setStandardIdentification( std::string const & );
setSTID(std::string const & str)154       void setSTID( std::string const & str ) { setStandardIdentification( str ); }
155 
156       void setStandardVersion( std::string const & );
setSTVS(std::string const & str)157       void setSTVS( std::string const & str ) {  setStandardVersion( str ); }
158 
159       void setStandardDocumentationReference( std::string const & );
setDOCU(std::string const & str)160       void setDOCU( std::string const & str ) {  setStandardDocumentationReference( str ); }
161 
162       void setProfileIdentification( std::string const & );
setPRID(std::string const & str)163       void setPRID( std::string const & str ) {  setProfileIdentification( str ); }
164 
165       void setProfileVersion( std::string const & );
setPRVS(std::string const & str)166       void setPRVS( std::string const & str ) {  setProfileVersion( str ); }
167 
168       void setProfileDocumentationReference( std::string const & );
setPDOC(std::string const & str)169       void setPDOC( std::string const & str ) {  setProfileDocumentationReference( str ); }
170 
171       void setTitle( std::string const & );
setTITL(std::string const & str)172       void setTITL( std::string const & str ) {  setTitle( str ); }
173 
174       void setDataID( std::string const & );
setDAID(std::string const & str)175       void setDAID( std::string const & str ) {  setDataID( str ); }
176 
177       void setDataStructure( std::string const & );
setDAST(std::string const & str)178       void setDAST( std::string const & str ) {  setDataStructure( str ); }
179 
180       void setMapDate( std::string const & );
setMPDT(std::string const & str)181       void setMPDT( std::string const & str ) {  setMapDate( str ); }
182 
183       void setDataSetCreationDate( std::string const & );
setDCDT(std::string const & str)184       void setDCDT( std::string const & str ) {  setDataSetCreationDate( str ); }
185 
186       void setScale( long );
setSCAL(long val)187       void setSCAL( long val ) {  setScale( val ); }
188 
189       void setComment( std::string const & );
setCOMT(std::string const & str)190       void setCOMT( std::string const & str ) {  setComment( str ); }
191 
192 
193       // Conformance Field
194 
195       void setComposites( std::string const & );
setFFYN(std::string const & str)196       void setFFYN( std::string const & str ) {  setComposites( str ); }
197 
198       void setVectorGeometry( std::string const & );
setVGYN(std::string const & str)199       void setVGYN( std::string const & str ) {  setVectorGeometry( str ); }
200 
201       void setVectorTopology( std::string const & );
setGTYN(std::string const & str)202       void setGTYN( std::string const & str ) {  setVectorTopology( str ); }
203 
204       void setRaster( std::string const & );
setRCYN(std::string const & str)205       void setRCYN( std::string const & str ) {  setRaster( str ); }
206 
207       void setExternalSpatialReference( long );
setEXSP(long val)208       void setEXSP( long val ) {  setExternalSpatialReference( val ); }
209 
210       void setFeaturesLevel( long );
setFTLV(long val)211       void setFTLV( long val ) {  setFeaturesLevel( val ); }
212 
213       void setCodingLevel( long );
setCDLV(long val)214       void setCDLV( long val ) {  setCodingLevel( val ); }
215 
216       void setNonGeoSpatialDimensions( std::string const & );
setNGDM(std::string const & str)217       void setNGDM( std::string const & str ) {  setNonGeoSpatialDimensions( str ); }
218 
219 
220 #ifdef NOT_IMPLEMENTED
221       void setAttributeID( sb_ForeignID const & );
setATID(sb_ForeignID const & fid)222       void setATID( sb_ForeignID const & fid ) {  setAttributeID( fid ); }
223 #endif
224 
225 
226       /**
227        set the object with values found in the record; if not a valid
228        IDEN record, this will return false
229       */
230       bool setRecord( sc_Record const& record );
231 
232 
233    private:
234 
235       /// returns reference to schema
236       virtual sio_8211Schema& schema_();
237 
238       ///
239       virtual void buildSpecificSchema_();
240 
241 
242       /// NOT NEEDED
243       sb_Iden( sb_Iden const & );
244 
245       /// hidden opaque data type containing internals
246       sb_Iden_Imp*  imp_;
247 
248 }; // sb_Iden
249 
250 
251 
252 #endif
253