- Main Page
- Namespaces
- Classes
- Files
- Related Pages

# /Users/fpy/titan-1-5-MBARI/Mers/Models/CCA/CCAStates.h

    00001
    00002 //
    00003 // Copyright (c) 2004           Model-based Embedded and Robotic Systems Group
    00004 // All Rights Reserved          Massachusetts Institute of Technology
    00005 //
    00006 // This software is provided as is. Model-based Embedded and Robotic Systems
    00007 // (MERS) group does not assume any responsibility.
    00008 //
    00009 // Organization:        Model-based Embedded and Robotic Systems Group
    00010 //                                      Massachusetts Institute of Technology
    00011 //
    00013
    00014 #ifndef __CCASTATES__
    00015 #define __CCASTATES__
    00016
    00017 #ifdef _MSC_VER
    00018 #pragma warning( disable : 4786 )
    00019 #endif
    00020
    00021 #include <Mers/Utils/Containers/ObjectArray.h>
    00022
    00023 #include "CCAValue.h"
    00024 #include "CCAState.h"
    00025
    00026 namespace Mers {
    00027         namespace Models {
    00028                 namespace CCA {
    00029
    00030                         class CCAModel;
    00031                         class CCAAutomaton;
    00032                         class CCATransition;
    00033
    00042                         class CCAStates : public Mers::Utils::Containers::ObjectArray
    00043                         {
    00044                         public:
    00046                                 // Type Definitions & Constants
    00048                                 typedef unsigned int    sizeType;
    00049
    00051                                 // Constructors, Copy Constructors, & Destructors
    00053
    00060                                 CCAStates(bool myOwnershipStatus);
    00061                                 CCAStates(const CCAStates &other);
    00062                                 ~CCAStates();
    00063
    00065                                 // Iterators
    00067
    00068                                 typedef CCAState * pointer;
    00069                                 typedef const CCAState * const_pointer;
    00070                                 typedef CCAStates ContainerType;
    00071                                 typedef Mers::Utils::Containers::IteratorTemplate<const_pointer, ContainerType> const_iterator;
    00072                                 typedef Mers::Utils::Containers::IteratorTemplate<pointer, ContainerType> iterator;
    00073                                 typedef const_iterator ConstantIterator;
    00074                                 typedef iterator Iterator;
    00075
    00077                                 // Public Function Members
    00079                                 bool                                    empty()                                                                         const;
    00080                                 void                                    clear();
    00081
    00087                                 Iterator begin()
    00088                                 {
    00089                                         return Iterator(this, 0);
    00090                                 }
    00097                                 ConstantIterator begin() const
    00098                                 {
    00099                                         return ConstantIterator((ContainerType *)this, 0);
    00100                                 }
    00101
    00108                                 Iterator         end()
    00109                                 {
    00110                                         return Iterator(this, getLength());
    00111                                 }
    00118                                 ConstantIterator end() const
    00119                                 {
    00120                                         return ConstantIterator((ContainerType *)this, getLength());
    00121                                 }
    00123                                 bool                                    set_automaton_p(const CCAAutomaton &_automaton);
    00124                                 const_iterator                  insert_state(const CCAState &new_state);
    00125                                 const CCAState *                state_p(const CCAValue &_value)                         const;
    00126                                 bool                                    insert_in_transition(const CCAState &_state,
    00127                                                                                                                                                                          CCATransition * _transition);
    00128                                 bool                                    insert_out_transition(const CCAState &_state,
    00129                                                                                                                                                                                 CCATransition * _transition);
    00130                                 bool                                    set_type(const CCAState &_state,
    00131                                                                                                                          const CCAState::StateType _type);
    00132                                 bool                                    set_constraint(const CCAState &_state,
    00133                                                                                                                                                  const CCASentence &_constraint);
    00134
    00146                                 int pushBack(CCAState * data);
    00154                                 CCAState * popBack();
    00155
    00156 #ifndef EMBEDDED
    00157
    00161                                 void print(std::ostream &out) const;
    00162 #endif
    00163
    00165                                 // Public Operators
    00167                                 bool                                    operator ==(const CCAStates &other)                     const;
    00168                                 bool                                    operator !=(const CCAStates &other)                     const;
    00169
    00178                                 CCAState * & operator[](int elementIndex);
    00187                                 CCAState * & operator[](unsigned int elementIndex);
    00196                                 CCAState const * & operator[](int elementIndex) const;
    00205                                 CCAState const * & operator[](unsigned int elementIndex) const;
    00206
    00216                                 CCAStates const & operator =(CCAStates const &other);
    00225                                 CCAStates const & operator +=(CCAStates const &other);
    00235                                 CCAStates const & operator +=(CCAState const &data);
    00236
    00237                         protected:
    00246                                 void * newElement(void const * element) const;
    00257                                 bool isEqual(void const * element1, void const * element2) const;
    00258                         };
    00259                 }
    00260         }
    00261 }
    00262
    00263 #endif