Subversion Repositories DevTools

Rev

Rev 2222 | Blame | Compare with Previous | Last modification | View Log | RSS feed

//## begin module%1.7%.codegen_version preserve=yes
//   Read the documentation to learn more about C++ code generator
//   versioning.
//## end module%1.7%.codegen_version

//## begin module%41F607FA0261.cm preserve=no
//## end module%41F607FA0261.cm

//## begin module%41F607FA0261.cp preserve=no
//      C O P Y R I G H T   N O T I C E
//      This material is confidential to ERG and may not be disclosed in whole
//      or in part to any third party nor used in any manner whatsoever other
//      than for the purposes expressly consented to by ERG in writing.
//
//      This material is also copyright and may not be reproduced, stored in a
//      retrieval system or transmitted in any form or by any means in whole or
//      in part without the express written consent of ERG.
//## end module%41F607FA0261.cp

//## Module: TransactionSpecification%41F607FA0261; Pseudo Package specification
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
//## Source file: Z:\MASS_Dev\Tools\TxnTestManager\src\TransactionSpecification.h

#ifndef TransactionSpecification_h
#define TransactionSpecification_h 1

//## begin module%41F607FA0261.additionalIncludes preserve=no
//## end module%41F607FA0261.additionalIncludes

//## begin module%41F607FA0261.includes preserve=yes
#include <map>
#include <string>
#include <vector>
//## end module%41F607FA0261.includes


namespace XMLSchema {
class IXmlSchemaWrapperString;
} // namespace XMLSchema

class TestScenario;
class ProgressBar;
namespace XMLSchema {
class IXmlSchemaWrapperElement;
} // namespace XMLSchema

class TransactionSpecificationValue;
class EvaluationContext;
class TransactionStream;
class TransactionStructure;

//## begin module%41F607FA0261.additionalDeclarations preserve=yes
//## end module%41F607FA0261.additionalDeclarations


//## begin TransactionSpecification%41F607FA0261.preface preserve=yes
//## end TransactionSpecification%41F607FA0261.preface

//## Class: TransactionSpecification%41F607FA0261; private
//      A transaction specification.  During transaction generation, specifications
//      are instantiated by evaluating its values.
//## Category: TransactionTestManager::Transaction Specification%41FD9D7902B3
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
//## Persistence: Transient
//## Cardinality/Multiplicity: n



//## Uses: <unnamed>%4204641103B1;Iteration { -> }
//## Uses: <unnamed>%4204646E03E0;XMLSchema::IXmlSchemaWrapperSchema { -> }
//## Uses: <unnamed>%4204675A008D;XMLSchema::IXmlSchemaWrapperFactory { -> }
//## Uses: <unnamed>%42081AA001ED;TransactionStream { -> F}
//## Uses: <unnamed>%420892B9002C;ProgressBar { -> F}
//## Uses: <unnamed>%4211735E0064;EvaluationContext { -> F}
//## Uses: <unnamed>%4211BFAD03A0;EvaluationCallback { -> }
//## Uses: <unnamed>%4211D1FE0324;TimeEstimate { -> }
//## Uses: <unnamed>%4212E27501FC;MacQualification { -> }
//## Uses: <unnamed>%4212E76E027F;XMLSchema::IXmlSchemaWrapperByteArray { -> }
//## Uses: <unnamed>%4212E8CF00AA;IMessageDigest { -> }
//## Uses: <unnamed>%423695CE02A1;XMLSchema::IXmlSchemaWrapperStream { -> }
//## Uses: <unnamed>%4288499E035A;IHash { -> }

class TransactionSpecification 
{
  //## begin TransactionSpecification%41F607FA0261.initialDeclarations preserve=yes
  //## end TransactionSpecification%41F607FA0261.initialDeclarations

  public:
    //## Constructors (specified)
      //## Operation: TransactionSpecification%41F7060D0204
      //        This constructor creates a schema-less instance.
      TransactionSpecification (const int &transactionSpecificationNumber       // The transaction specification number of this transaction.
      );

      //## Operation: TransactionSpecification%42045473030D
      //        This constructor creates an instance bound to a scenario.
      TransactionSpecification (const int &transactionSpecificationNumber,      // The transaction specification number of this transaction.
      const std::string &payloadStructureName,  // The name of the structure that describes the payload of this transaction.
      TestScenario& scenario    // The scenario for which this transaction is defined.  While we do not accept
        // ownership over this instance, we do assume its validity for the remainder
        // of our lifetime.
      );

    //## Destructor (generated)
      virtual ~TransactionSpecification();


    //## Other Operations (specified)
      //## Operation: addMacField%4212DBC1031E
      //        Add the given schema element to the collection of elements to which the MAC
      //        of the structure is to be assigned.
      void addMacField (XMLSchema::IXmlSchemaWrapperElement &element    // The element.
      );

      //## Operation: addValue%41F70652035C
      //        Add the value with the given xpath to this transaction.  When the value
      //        cannot be added, raise an exception.
      void addValue (const std::string &xPath,  // The xpath of the value.
      const std::string &value,         // The value.
      const bool &obsolete      // Of value true when the value is obsolete, and of value false otherwise.
      );

      //## Operation: clearMarks%41F705790276
      //        Unmark all values.
      void clearMarks ();

      //## Operation: generate%4204564D02F3
      //        Generate this transaction and evaluate to true, or to false when any
      //        transaction cannot be evaluated.
      const bool generate (TransactionStream& stream,   // The stream into which to generate.
      const bool &generateHeaders,      // When true, the transaction stream contains transaction header.  Otherwise,
        // the transaction steam does not contain transaction headers.
      EvaluationContext& evaluationContext      // The evaluation context.
      );

      //## Operation: getCurrentStructure%4213183F01DD
      //        Evaluate to the current structure being traversed.
      const TransactionStructure & getCurrentStructure () const;

      //## Operation: getFormatVersion%4208BB80011D
      //        Evaluate to the format version of the schema that defines this structure.
      const int & getFormatVersion () const;

      //## Operation: getScenario%420471B00192
      //        Evaluate to the scenario for which this transaction is defined.
      const TestScenario & getScenario () const;

      //## Operation: getTransactionField%4204283B033E
      //        Evaluate to the given transaction field.  When the object doesn't already
      //        exist, create it.
      TransactionSpecificationValue& getTransactionField (const std::string &xpath      // The xpath of the field.
      );

      //## Operation: getTransactionSpecificationNumber%41F71AD2002F
      //        Evaluate to the transaction specification number of this transaction.
      const int & getTransactionSpecificationNumber () const;

      //## Operation: getUdSubtype%4208AFAF01F7
      //        Evaluate to the UD subtype of this transaction.
      const unsigned short & getUdSubtype () const;

      //## Operation: getUdType%4208AFAF0245
      //        Evaluate to the UD type of this transaction.
      const unsigned short & getUdType () const;

      //## Operation: getValues%41F705A600AC
      //        Get the collection of defined values.
      const std::map< std::string, TransactionSpecificationValue * > & getValues () const;

      //## Operation: isContained%41F70575014E
      //        Evaluate to true when a value with the given xpath is defined, and to false
      //        otherwise.
      const bool isContained (const std::string &xPath  // The xpath of the value.
      ) const;

      //## Operation: isMarked%41F708CB0307
      //        Evaluate to true when the value with the given xPath is marked, and to false
      //        otherwise.  When no value with the given xPath is contained, raise an
      //        exception.
      const bool isMarked (const std::string &xPath     // The xpath of the value.
      ) const;

      //## Operation: markValue%41F7069E002F
      //        Mark the value with the given xpath.  When no value with the given xPath is
      //        contained, raise an exception.
      void markValue (const std::string &xPath  // The xpath of the value.
      );

      //## Operation: setUdSubtype%42044110019A
      //        Set the UD subtype and evaluate to the resulting value.
      const unsigned short & setUdSubtype (const unsigned short &value  // The value.
      );

      //## Operation: setUdType%420440DE038E
      //        Set the UD type and evaluate to the resulting value.
      const unsigned short & setUdType (const unsigned short &value     // The value.
      );

      //## Operation: evaluate%4205C6F500FC
      //        Evaluate the given field using the given context.
      virtual const bool evaluate (XMLSchema::IXmlSchemaWrapperElement &element,        // The schema element being visited.
      EvaluationContext& context        // The context.
      );

    // Additional Public Declarations
      //## begin TransactionSpecification%41F607FA0261.public preserve=yes
      //## end TransactionSpecification%41F607FA0261.public

  protected:
    // Additional Protected Declarations
      //## begin TransactionSpecification%41F607FA0261.protected preserve=yes
      //## end TransactionSpecification%41F607FA0261.protected

  private:
    //## Constructors (generated)
      TransactionSpecification();

      TransactionSpecification(const TransactionSpecification &right);

    //## Assignment Operation (generated)
      TransactionSpecification & operator=(const TransactionSpecification &right);


    //## Other Operations (specified)
      //## Operation: clearMacFields%42130B2D0377
      //        Clear the collection of fields to MAC.
      void clearMacFields ();

    // Data Members for Class Attributes

      //## Attribute: headerStructureName%4206D764033E
      //        The name of the structure that describes the header of this transaction.
      //## begin TransactionSpecification::headerStructureName%4206D764033E.attr preserve=no  private: static char {RAC} "SysHdr_t"
      static const char *g_headerStructureName;
      //## end TransactionSpecification::headerStructureName%4206D764033E.attr

      //## Attribute: structureIndex%4206D2C800CF
      //        The index of the structure currently being traversed.
      //## begin TransactionSpecification::structureIndex%4206D2C800CF.attr preserve=no  private: unsigned {VA} 0
      unsigned m_structureIndex;
      //## end TransactionSpecification::structureIndex%4206D2C800CF.attr

      //## Attribute: structureName%4204415E01B9
      //        The name of the structure that describes the payload of this transaction.
      //## begin TransactionSpecification::structureName%4204415E01B9.attr preserve=no  private: std::string {VA} 
      std::string m_structureName;
      //## end TransactionSpecification::structureName%4204415E01B9.attr

      //## Attribute: transactionSpecificationNumber%41F7044B0238
      //        The transaction specification number of the field.
      //## begin TransactionSpecification::transactionSpecificationNumber%41F7044B0238.attr preserve=no  private: int {VA} 0
      int m_transactionSpecificationNumber;
      //## end TransactionSpecification::transactionSpecificationNumber%41F7044B0238.attr

      //## Attribute: udSubtype%420441600265
      //        The UD subtype of this transaction.
      //## begin TransactionSpecification::udSubtype%420441600265.attr preserve=no  private: unsigned short {VA} 0
      unsigned short m_udSubtype;
      //## end TransactionSpecification::udSubtype%420441600265.attr

      //## Attribute: udType%4204415F0226
      //        The UD type of this transaction.
      //## begin TransactionSpecification::udType%4204415F0226.attr preserve=no  private: unsigned short {VA} 0
      unsigned short m_udType;
      //## end TransactionSpecification::udType%4204415F0226.attr

      //## Attribute: formatVersion%4208C3670196
      //        The format version of the schema that defines this structure.
      //## begin TransactionSpecification::formatVersion%4208C3670196.attr preserve=no  private: int {VA} 0
      int m_formatVersion;
      //## end TransactionSpecification::formatVersion%4208C3670196.attr

    // Data Members for Associations

      //## Association: TransactionTestManager::Transaction Specification::<unnamed>%41F610D90055
      //## Role: TransactionSpecification::value%41F610D90297
      //        The values defined for this instance.
      //## Qualifier: xpath%41F610F603B0; std::string
      //        The xpath of the field.
      //## begin TransactionSpecification::value%41F610D90297.role preserve=no  private: TransactionSpecificationValue {1 -> 1RFHgAN}
      std::map<std::string, TransactionSpecificationValue *> m_value;
      //## end TransactionSpecification::value%41F610D90297.role

      //## Association: TransactionTestManager::Transaction Generation::<unnamed>%42044DA10263
      //## Role: TransactionSpecification::scenario%42044DA20263
      //        The scenario for which this transaction is defined.  While we do not accept
      //        ownership over this instance, we do assume its validity for the remainder of
      //        our lifetime.
      //## begin TransactionSpecification::scenario%42044DA20263.role preserve=no  private: TestScenario {1 -> 1RFHAN}
      TestScenario *m_scenario;
      //## end TransactionSpecification::scenario%42044DA20263.role

      //## Association: TransactionTestManager::Transaction Generation::<unnamed>%4205CC83034E
      //## Role: TransactionSpecification::string%4205CC8600CE
      //        A string for interacting with the schema.  We aggregate it because we're
      //        about to need for every schema element whenever we visit it.
      //## begin TransactionSpecification::string%4205CC8600CE.role preserve=no  private: XMLSchema::IXmlSchemaWrapperString {1 -> 1RFHgAN}
      XMLSchema::IXmlSchemaWrapperString *m_string;
      //## end TransactionSpecification::string%4205CC8600CE.role

      //## Association: TransactionTestManager::Transaction Generation::<unnamed>%4205D27303DF
      //## Role: TransactionSpecification::structure%4205D274021A
      //        The collection of structures associated with this transaction.
      //## begin TransactionSpecification::structure%4205D274021A.role preserve=no  private: TransactionStructure {1 -> *RFHgAN}
      std::vector< TransactionStructure * > m_structure;
      //## end TransactionSpecification::structure%4205D274021A.role

      //## Association: TransactionTestManager::Transaction Generation::<unnamed>%4212DB3900A3
      //## Role: TransactionSpecification::macFields%4212DB3903B0
      //        The collection of schema elements to which we must assign the MAC that we
      //        need to compute for this transaction.
      //## begin TransactionSpecification::macFields%4212DB3903B0.role preserve=no  private: XMLSchema::IXmlSchemaWrapperElement {1 -> *RFHgAN}
      std::vector< XMLSchema::IXmlSchemaWrapperElement * > m_macFields;
      //## end TransactionSpecification::macFields%4212DB3903B0.role

    // Additional Private Declarations
      //## begin TransactionSpecification%41F607FA0261.private preserve=yes
      //## end TransactionSpecification%41F607FA0261.private

  private: //## implementation
    // Additional Implementation Declarations
      //## begin TransactionSpecification%41F607FA0261.implementation preserve=yes
      //## end TransactionSpecification%41F607FA0261.implementation

};

//## begin TransactionSpecification%41F607FA0261.postscript preserve=yes
//## end TransactionSpecification%41F607FA0261.postscript

// Class TransactionSpecification 

//## begin module%41F607FA0261.epilog preserve=yes
//## end module%41F607FA0261.epilog


#endif