Example #1
0
robKinematics* robKinematics::Instantiate( const std::string& type ){

  std::string convention( type );
  std::transform( convention.begin(),
		  convention.end(),
		  convention.begin(),
		  ::toupper );
  
  if( convention.compare( "STANDARD" ) == 0 )
    { return (robKinematics*) new robDH; }

  if( convention.compare( "MODIFIED" ) == 0 )
    { return (robKinematics*) new robModifiedDH; }

  if( convention.compare( "HAYATI" ) == 0 )
    { return (robKinematics*) new robHayati; }

  return NULL;
}
FunctionSignature GenericDescriptorAnalyzer::getFunctionSignature() const {
    FunctionSignature signature;

    struct Counts {
        std::size_t defs;
        std::size_t uses;

        Counts(): defs(0), uses(0) {}
    };

    /*
     * Estimate the memory locations of arguments.
     */
    boost::unordered_map<MemoryLocation, Counts> argVotes;

    std::size_t callsCount = callAnalyzers_.size();
    std::size_t functionsCount = 0;

    foreach (GenericCallAnalyzer *callAnalyzer, callAnalyzers_) {
        foreach (const MemoryLocation &memoryLocation, callAnalyzer->argumentLocations()) {
            ++argVotes[memoryLocation].defs;
        }
    }