This repository has been archived by the owner on Oct 9, 2018. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added StandardComponentFactory, StandardStimulusFactory, and related …
…classes. Removed unused ObjectFactory source files.
- Loading branch information
Showing
14 changed files
with
614 additions
and
190 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* ComponentInfo.h | ||
* MWorksCore | ||
* | ||
* Created by Christopher Stawarz on 3/24/11. | ||
* Copyright 2011 MIT. All rights reserved. | ||
* | ||
*/ | ||
|
||
#ifndef _MW_COMPONENT_INFO_H | ||
#define _MW_COMPONENT_INFO_H | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include "ParameterInfo.h" | ||
|
||
|
||
BEGIN_NAMESPACE(mw) | ||
|
||
|
||
class ComponentInfo { | ||
|
||
public: | ||
typedef std::vector<std::string> StdStringVector; | ||
|
||
void setSignature(const std::string &newSignature) { | ||
signature = newSignature; | ||
} | ||
|
||
void addParameter(const std::string &name, const std::string &defaultValue) { | ||
addParameter(name, ParameterInfo(defaultValue)); | ||
} | ||
|
||
void addParameter(const std::string &name, bool required = true) { | ||
addParameter(name, ParameterInfo(required)); | ||
} | ||
|
||
void addParameter(const std::string &name, const ParameterInfo &info) { | ||
parameters[name] = info; | ||
if (info.isRequired()) { | ||
requiredParameters.push_back(name); | ||
} | ||
} | ||
|
||
const std::string& getSignature() const { | ||
return signature; | ||
} | ||
|
||
const ParameterInfoMap& getParameters() const { | ||
return parameters; | ||
} | ||
|
||
const StdStringVector& getRequiredParameters() const { | ||
return requiredParameters; | ||
} | ||
|
||
private: | ||
std::string signature; | ||
ParameterInfoMap parameters; | ||
StdStringVector requiredParameters; | ||
|
||
}; | ||
|
||
|
||
END_NAMESPACE(mw) | ||
|
||
|
||
#endif | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.