Subversion Repositories DevTools

Rev

Rev 2218 | 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%42030C2C00B8.cm preserve=no
//## end module%42030C2C00B8.cm

//## begin module%42030C2C00B8.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%42030C2C00B8.cp

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

#ifndef TestScenario_h
#define TestScenario_h 1

//## begin module%42030C2C00B8.additionalIncludes preserve=no
//## end module%42030C2C00B8.additionalIncludes

//## begin module%42030C2C00B8.includes preserve=yes
#include <map>
#include <vector>
//## end module%42030C2C00B8.includes


class Iteration;
class TransactionSpecification;
class EvaluationContext;
class TransactionStream;
class DefinedVariable;

//## begin module%42030C2C00B8.additionalDeclarations preserve=yes
//## end module%42030C2C00B8.additionalDeclarations


//## begin TestScenario%42030C2C00B8.preface preserve=yes
//## end TestScenario%42030C2C00B8.preface

//## Class: TestScenario%42030C2C00B8; private
//      A test scenario.
//## Category: TransactionTestManager::Transaction Generation%4202F8EE0128
//## Subsystem: MASS::Dev::Tools::TxnTestManager::src%41F5A79001E4
//## Persistence: Transient
//## Cardinality/Multiplicity: n



//## Uses: <unnamed>%42081A9901FD;TransactionStream { -> F}
//## Uses: <unnamed>%421173580036;EvaluationContext { -> F}

class TestScenario 
{
  //## begin TestScenario%42030C2C00B8.initialDeclarations preserve=yes
  //## end TestScenario%42030C2C00B8.initialDeclarations

  public:
    //## Constructors (specified)
      //## Operation: TestScenario%4203231D030E
      //        The only constructor.
      TestScenario (const int &scenario,        // The primary key of the scenario.
      Iteration& iteration      // The iteration for which this object 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 ~TestScenario();


    //## Other Operations (specified)
      //## Operation: defineVariable%425B47DD004F
      //        Define the given variable and evaluate to it.
      DefinedVariable& defineVariable (const std::string &variableName  // The name of the variable.
      );

      //## Operation: generate%420455D80390
      //        Generate the transactions defined for this scenario and evaluate to true, or
      //        to false when any transaction cannot be generated.
      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: getBatchSize%42042C5E0029
      //        Evaluate to the number of transactions contained in a batch.
      const unsigned & getBatchSize () const;

      //## Operation: getIteration%420460EA003C
      //        Evaluate to the iteration for which this scenario is defined.
      const Iteration & getIteration () const;

      //## Operation: getRepeatCount%42042C5D02F8
      //        Evaluate to the number of times that this scenario is played into the
      //        transaction stream.
      const unsigned & getRepeatCount () const;

      //## Operation: getScenarioName%42084D3A0270
      //        Get the scenario name.
      const std::string & getScenarioName () const;

      //## Operation: getScenarioNumber%4203252300A6
      //        Evaluate to the scenario number of this instance.
      const int & getScenarioNumber () const;

      //## Operation: getTransactionCount%420890BF03BE
      //        Evaluate to the number of transactions in this scenario multiplied by the
      //        repeat count.
      const unsigned getTransactionCount () const;

      //## Operation: getTransactionSpecification%420328E00043
      //        Evaluate to the given transaction.  When the transaction doesn't already
      //        exist, create it.
      TransactionSpecification& getTransactionSpecification (const int &transaction,    // The identity of the transaction.
      const std::string &payloadStructureName   // The name of the structure that describes the payload of this transaction.
      );

      //## Operation: getVariable%425B47F50012
      //        Evaluate to the given variable.
      DefinedVariable& getVariable (const std::string &variableName     // The name of the variable.
      );

      //## Operation: isVariable%425B4B6A01C1
      //        Evaluate to true when the given symbol is a variable, otherwise evaluate to
      //        false.
      const bool isVariable (const std::string &symbol  // The symbol.
      ) const;

      //## Operation: setBatchSize%42042CF100D5
      //        Set the batch size and evaluate to the resulting value.
      const unsigned & setBatchSize (const unsigned &value      // The value.
      );

      //## Operation: setRepeatCount%42042CF100E5
      //        Set the repeat count and evaluate to the resulting value.
      const unsigned & setRepeatCount (const unsigned &value    // The value.
      );

      //## Operation: setScenarioName%42084D300222
      //        Set the scenario name, and evaluate to it.
      std::string & setScenarioName (const std::string &value   // The scenario name.
      );

    // Additional Public Declarations
      //## begin TestScenario%42030C2C00B8.public preserve=yes
      //## end TestScenario%42030C2C00B8.public

  protected:
    // Additional Protected Declarations
      //## begin TestScenario%42030C2C00B8.protected preserve=yes
      //## end TestScenario%42030C2C00B8.protected

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

      TestScenario(const TestScenario &right);

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


    //## Other Operations (specified)
      //## Operation: buildBatchName%4208537A00B6
      //        Build a batch name from the given scenario name and evaluate to it.
      std::string & buildBatchName (std::string &batchName,     // The value to which this method evaluates.
      const std::string &scenarioName   // The scenario name.
      );

    // Data Members for Class Attributes

      //## Attribute: batchSize%42042D510058
      //        The number of transactions in a batch.
      //## begin TestScenario::batchSize%42042D510058.attr preserve=no  private: unsigned {VA} 0
      unsigned m_batchSize;
      //## end TestScenario::batchSize%42042D510058.attr

      //## Attribute: repeatCount%42042D6D0029
      //        The number of times that this scenario is played into the transaction stream.
      //## begin TestScenario::repeatCount%42042D6D0029.attr preserve=no  private: unsigned {VA} 0
      unsigned m_repeatCount;
      //## end TestScenario::repeatCount%42042D6D0029.attr

      //## Attribute: scenario%4203255B026B
      //        The transaction specification number of this transaction.
      //## begin TestScenario::scenario%4203255B026B.attr preserve=no  private: int {VAC} 
      const int m_scenario;
      //## end TestScenario::scenario%4203255B026B.attr

      //## Attribute: scenarioName%42084D0601B5
      //        The name of this scenario.
      //## begin TestScenario::scenarioName%42084D0601B5.attr preserve=no  private: std::string {VA} 
      std::string m_scenarioName;
      //## end TestScenario::scenarioName%42084D0601B5.attr

    // Data Members for Associations

      //## Association: TransactionTestManager::Transaction Generation::<unnamed>%42030C7F020F
      //## Role: TestScenario::transaction%42030C7F0396
      //        The collection of transactions of this scenario.
      //## Qualifier: transaction%42030C89001B; int
      //        The primary key of the transaction.
      //## begin TestScenario::transaction%42030C7F0396.role preserve=no  private: TransactionSpecification {1 -> 1RFHgAN}
      std::map<int, TransactionSpecification *> m_transaction;
      //## end TestScenario::transaction%42030C7F0396.role

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

      //## Association: TransactionTestManager::Transaction Generation::<unnamed>%42071055018B
      //## Role: TestScenario::orderedTransactionCollection%4207105502F2
      //        The collection of transactions in generation order.
      //## begin TestScenario::orderedTransactionCollection%4207105502F2.role preserve=no  private: TransactionSpecification {1 -> *RFHAN}
      std::vector< TransactionSpecification * > m_orderedTransactionCollection;
      //## end TestScenario::orderedTransactionCollection%4207105502F2.role

      //## Association: TransactionTestManager::Symbol Table::<unnamed>%425B3A290039
      //## Role: TestScenario::variable%425B3A29023D
      //        The collection of variables defined for this scneario.
      //## Qualifier: variableName%425B3A580384; std::string
      //        The name of the variable.
      //## begin TestScenario::variable%425B3A29023D.role preserve=no  private: DefinedVariable {1 -> 1RFHgAN}
      std::map<std::string, DefinedVariable *> m_variable;
      //## end TestScenario::variable%425B3A29023D.role

    // Additional Private Declarations
      //## begin TestScenario%42030C2C00B8.private preserve=yes
      //## end TestScenario%42030C2C00B8.private

  private: //## implementation
    // Additional Implementation Declarations
      //## begin TestScenario%42030C2C00B8.implementation preserve=yes
      //## end TestScenario%42030C2C00B8.implementation

};

//## begin TestScenario%42030C2C00B8.postscript preserve=yes
//## end TestScenario%42030C2C00B8.postscript

// Class TestScenario 

//## begin module%42030C2C00B8.epilog preserve=yes
//## end module%42030C2C00B8.epilog


#endif