Merge pull request #1079 from asuessenbach/refactor

Refactor command generation.
This commit is contained in:
Andreas Süßenbach 2021-09-23 08:32:36 +02:00 committed by GitHub
commit ae8726e30f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 918 additions and 796 deletions

File diff suppressed because it is too large Load Diff

View File

@ -443,6 +443,10 @@ private:
size_t paramIndex, size_t paramIndex,
std::set<size_t> const & singularParams, std::set<size_t> const & singularParams,
std::vector<size_t> const & returnParamIndices ) const; std::vector<size_t> const & returnParamIndices ) const;
std::string generateCommand( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandDefinitions( std::vector<RequireData> const & requireData, std::string generateCommandDefinitions( std::vector<RequireData> const & requireData,
std::set<std::string> & listedCommands, std::set<std::string> & listedCommands,
std::string const & title ) const; std::string const & title ) const;
@ -558,80 +562,97 @@ private:
bool definition, bool definition,
std::map<size_t, size_t> const & vectorParamIndices, std::map<size_t, size_t> const & vectorParamIndices,
size_t returnParamIndex ) const; size_t returnParamIndex ) const;
std::string generateCommandSet( std::string const & name, std::string generateCommandResultMultiSuccessNoErrors( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition ) const; bool definition ) const;
std::string generateCommandSetResult( std::string const & name, std::string generateCommandResultMultiSuccessWithErrors( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition ) const; bool definition ) const;
std::string generateCommandSetResultMultiSuccess( std::string const & name, std::string generateCommandResultMultiSuccessWithErrors0Return( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition ) const; bool definition ) const;
std::string generateCommandSetResultMultiSuccessWithoutErrors( std::string const & name, std::string generateCommandResultMultiSuccessWithErrors1Return( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandSetResultMultiSuccessWithErrors( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandSetResultMultiSuccessWithErrors0Vector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string
generateCommandSetResultMultiSuccessWithErrors1Vector( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition, bool definition,
std::pair<size_t, size_t> const & vectorParamIndex ) const; size_t returnParamIndex ) const;
std::string std::string
generateCommandSetResultMultiSuccessWithErrors2Vector( std::string const & name, generateCommandResultMultiSuccessWithErrors2Return( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition, bool definition,
std::map<size_t, size_t> const & vectorParamIndices ) const; std::vector<size_t> const & returnParamIndices ) const;
std::string generateCommandSetResultSingleSuccess( std::string const & name, std::string
generateCommandResultMultiSuccessWithErrors3Return( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
std::vector<size_t> const & returnParamIndices ) const;
std::string generateCommandResultSingleSuccessNoErrors( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition ) const; bool definition ) const;
std::string generateCommandSetResultSingleSuccessWithoutErrors( std::string const & name, std::string generateCommandResultSingleSuccessWithErrors( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition ) const; bool definition ) const;
std::string generateCommandSetResultSingleSuccessWithoutErrors0Vector( std::string const & name, std::string generateCommandResultSingleSuccessWithErrors0Return( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition ) const; bool definition ) const;
std::string generateCommandSetResultSingleSuccessWithoutErrors1Vector( std::string generateCommandResultSingleSuccessWithErrors1Return( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParamIndex ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnChain( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParamIndex ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnHandle( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParamIndex ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnHandle0Vector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParamIndex ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnHandle1Vector(
std::string const & name, std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition, bool definition,
size_t returnParamIndex,
std::pair<size_t, size_t> const & vectorParamIndex ) const; std::pair<size_t, size_t> const & vectorParamIndex ) const;
std::string generateCommandSetResultSingleSuccessWithErrors( std::string const & name, std::string generateCommandResultSingleSuccessWithErrors1ReturnHandle2Vector(
CommandData const & commandData, std::string const & name,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandSetResultSingleSuccessWithErrors0Vector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string
generateCommandSetResultSingleSuccessWithErrors1Vector( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition, bool definition,
std::pair<size_t, size_t> const & vectorParamIndex ) const; size_t returnParamIndex,
std::string std::map<size_t, size_t> const & vectorParamIndices ) const;
generateCommandSetResultSingleSuccessWithErrors2Vector( std::string const & name, std::string generateCommandResultSingleSuccessWithErrors1ReturnValue( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition, bool definition,
std::map<size_t, size_t> const & vectorParamIndex ) const; size_t returnParamIndex ) const;
std::string generateCommandResultSingleSuccessWithErrors1ReturnVoid( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParamIndex ) const;
std::string
generateCommandResultSingleSuccessWithErrors2Return( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
std::vector<size_t> const & returnParamIndices ) const;
std::string generateCommandSetStandard( std::string const & standard ) const; std::string generateCommandSetStandard( std::string const & standard ) const;
std::string generateCommandSetStandardEnhanced( bool definition, std::string generateCommandSetStandardEnhanced( bool definition,
std::string const & standard, std::string const & standard,
@ -690,32 +711,6 @@ private:
std::string const & enhancedUnique, std::string const & enhancedUnique,
std::string const & enhancedUniqueWithAllocator ) const; std::string const & enhancedUniqueWithAllocator ) const;
std::string generateCommandSetStandardOrEnhanced( std::string const & standard, std::string const & enhanced ) const; std::string generateCommandSetStandardOrEnhanced( std::string const & standard, std::string const & enhanced ) const;
std::string generateCommandSetValue( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandSetValue0Vector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandSetVoid( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandSetVoid0Vector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandSetVoid1Vector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
std::pair<size_t, size_t> const & vectorParamIndex ) const;
std::string generateCommandSetVoidNVector( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
std::map<size_t, size_t> const & vectorParamIndices ) const;
std::string generateCommandStandard( std::string const & name, std::string generateCommandStandard( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
@ -724,11 +719,29 @@ private:
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition ) const; bool definition ) const;
std::string generateCommandValue( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandVoid( std::string const & name, std::string generateCommandVoid( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,
bool definition, bool definition,
std::map<size_t, size_t> const & vectorParamIndices ) const; std::map<size_t, size_t> const & vectorParamIndices ) const;
std::string generateCommandVoid0Return( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition ) const;
std::string generateCommandVoid1Return( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
size_t returnParamIndex ) const;
std::string generateCommandVoid2Return( std::string const & name,
CommandData const & commandData,
size_t initialSkipCount,
bool definition,
std::vector<size_t> const & returnParamIndices ) const;
std::string generateCommandVoidEnumerate( std::string const & name, std::string generateCommandVoidEnumerate( std::string const & name,
CommandData const & commandData, CommandData const & commandData,
size_t initialSkipCount, size_t initialSkipCount,