• HOME
  • ABOUT
    AD&Co
    AD&Co Staff Vendor Partners News & Events Press Releases AD&Co in the News Contact Us
  • VECTORS™
    ANALYTICS
    Prepayment Credit Valuation RiskProfiler™ CreditProfile™
  • CONSULTING
  • PUBLICATIONS
    & RESEARCH
    The Pipeline The Pipeline Archives Quantitiative Perspectives Library Books & Papers Presentations
  • ONLINE TOOLS
    & REPORTS
    Model Demos Mortgage Analysis & Performance Reporting Market Valuation Reports Trend Reports CreditProfile™
  • VECTORS™
    SUPPORT
    Downloads FAQs Glossary Installation and Version Compatibility Model Description Model Validation Tuning Support User Manuals/Tutorials/Guides Release Notes Developer Support
  • My AD&Co
 
    Quick Links
  • API Integration Coding for Developers

API INTEGRATION CODING FOR DEVELOPERS

Enumeration Lists and List Elements: adco_cEnumeration & adco_cEnumElem

class adco_cEnumeration

Description

This class contains a collection of adco_cEnumElem items. Each list additionally has a name and a descriptive string. Enumerations are used to expose the list of models recognized by a model factory, parameters recognized by each specific subclass of CAdppmdl, return lists of warnings, and record the valid members of an enumerated parameter type. There is a special NullList with zero elements referred to by the exported global pNullList. The special exported global list element NULL_ELEM is a member of this list, but has no index.

Methods

Construction/Destruction

Construction/Destruction is handled by sub-class methods which are not exposed. References to the Enumerations internal to various classes can be created using methods of the owning class.

virtual void Initialize( void ) const

Used internally to avoid the chicken/egg problem for interdependent constants.

Descriptive

virtual const char* name() const

Retrieve the name of the list. If the list is referrenced via another list, this name will match the name of the referring element.

virtual const char* description() const

Retrieve the descriptive string for the list..

virtual unsigned int elem_count () const

Return the number of elements in the list..

bool operator==( const adco_cEnumeration& elist ) const

Returns true if the list is identical to the specified list..

bool operator!=( const adco_cEnumeration& elist ) const

               Returns true if the list is NOT identical to the specified list.

Contents

virtual bool contains( const adco_cEnumElem& e ) const

True if the list contains a partiuclar element.

virtual bool contains( const char* ename ) const

True if the list contains an element with the specified name..

virtual unsigned int idx( const char* ename ) const

Return the (zero-based) index of the name in the list. Throws an error if name is not in the list.

virtual const char* elem_name ( unsigned int n ) const

Return the name of the nth element of the list. Throws an error if n is equal or greater than the size of the list.

virtual adco_cEnumElem element( unsigned int n ) const

Return the nth enumerated element of the list. Throws an error if n is equal or greater than the size of the list.

virtual adco_cEnumElem element( const char* ename ) const

Return the enumerated element with the specified name. Throws an error if the name is not in the list.

virtual const char* elem_desc ( unsigned int n ) const

Return the descriptive string for the nth element of the list. Throws an error if n is equal or greater than the size of the list.

virtual const char* elem_desc ( const char* ename ) const

Return the descriptive sting for the list element with the specified name. Throws an error if the name is not in the list.

virtual const adco_cEnumElem elem_class ( unsigned int n ) const

Return the classification (see adco_cEnumElem) of the nth element of the list. Throws an error if n is equal or greater than the size of the list.

virtual const adco_cEnumElem elem_class ( const char* ename ) const

Return the classification (see adco_cEnumElem) of the element with the specified name. Throws an error if the name is not in the list.

virtual unsigned int idx( const adco_CParam& ParamElem ) const

For numeric parameters, returns the unsigned int value if the value is positive and less than the number of elements in the list. For string parameters, returns the index of element with the specified name. For enumerated parameters, returns the index of the element if it is from this list. Throws errors for values not found or out of bounds.

class adco_cEnumElem

Description

This class represents an element of a adco_cEnumeration list. Each element has a name, a descriptive string, and a classification, which is itself an adco_cEnumElem. List elements can be encapsulated in adco_CParam instances. The link-list of element classifications is terminated with the special element NULL_ELEM, a member of the Null_List.

Methods

Construction/Destruction

adco_cEnumElem( const adco_cEnumeration& elist, unsigned int elem_idx )

Construct an element referring to the elem_idxth element of elist. Throws an error if elem_idx is equal or greater than the size of the list.

adco_cEnumElem( const adco_cEnumeration& elist, const char* elem_name )

Construct an element referring to the element in elist with the specified name. Throws an error if the name isn't found in the list.

adco_cEnumElem( const adco_cEnumElem& ee)

Copy Constructor.

adco_cEnumElem& operator=( const adco_cEnumElem& ee )

Copy by Assignment. Returns reference to the new element.

Relation to containing adco_cEnumeration list

const adco_cEnumeration* list() const

Retrieve a pointer to the containing adco_cEnumeration list.

unsigned int idx() const

Retrieve the idx (zero based) of the element in it's containing adco_cEnumeration list.

operator unsigned int(void) const

Cast an element to unsigned int (returning idx() ). Useful for switch() statements, etc.

Descriptive

virtual const char* name() const

Retrieve the name of the list element (null terminated string).

virtual const char* description() const

Retrieve the elements (null terminated) descriptive string.

virtual const adco_cEnumElem classification() const

Retrieve the list element that classifies the element. Note this will often be
NULL_ELEM, the single pseudo-element of the special list NullList.

virtual bool operator==( const adco_cEnumElem& ee ) const

True if the two elements are identical (same index in same list).

virtual bool operator!=( const adco_cEnumElem& ee ) const

True if the two elements are from different lists, or have different indices in the same list.




65 Bleecker St., Fifth Floor New York NY 10012   tel 212.274.9075   fax 212.274.0545
© 2012 Andrew Davidson & Co., Inc.