本文整理汇总了C++中prop函数的典型用法代码示例。如果您正苦于以下问题:C++ prop函数的具体用法?C++ prop怎么用?C++ prop使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了prop函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prop
void MCWalkerConfiguration::loadEnsemble(MCWalkerConfiguration& other)
{
if(SampleStack.empty()) return;
Walker_t::PropertyContainer_t prop(1,PropertyList.size());
int nsamples=SampleStack.size();
for(int i=0; i<nsamples; ++i)
{
Walker_t* awalker=new Walker_t(getTotalNum());
// awalker->R = *(SampleStack[i]);
// awalker->Drift = 0.0;
awalker->R = SampleStack[i].R;
awalker->Grad = SampleStack[i].G;
awalker->Lap = SampleStack[i].L;
// Make sure properties is resized properly first
awalker->Properties.copy(prop);
RealType *myprop = awalker->getPropertyBase();
myprop[LOGPSI] = SampleStack[i].LogPsi;
myprop[LOCALENERGY] = SampleStack[i].KE + SampleStack[i].PE;
myprop[LOCALPOTENTIAL] = SampleStack[i].PE;
other.WalkerList.push_back(awalker);
// delete SampleStack[i];
}
SampleStack.clear();
}
示例2: AddArbitraryPropertyToParamListBuilder
void AddArbitraryPropertyToParamListBuilder( ICompoundProperty & parent,
const PropertyHeader &propHeader,
ISampleSelector &sampleSelector,
const std::string &rmanBaseType,
ParamListBuilder &ParamListBuilder
)
{
T prop( parent, propHeader.getName() );
if ( ! prop.valid() )
{
//TODO error message?
return;
}
std::string rmanType = GetPrmanScopeString(
GetGeometryScope( propHeader.getMetaData() ) ) + " ";
rmanType += rmanBaseType + " " + propHeader.getName();
typename T::sample_ptr_type propSample = prop.getValue( sampleSelector );
ParamListBuilder.add( rmanType, (RtPointer)propSample->get(), propSample );
}
示例3: prop
void
prop(Reg *r, Bits ref, Bits cal)
{
Reg *r1, *r2;
int z;
for(r1 = r; r1 != R; r1 = (Reg*)r1->f.p1) {
for(z=0; z<BITS; z++) {
ref.b[z] |= r1->refahead.b[z];
if(ref.b[z] != r1->refahead.b[z]) {
r1->refahead.b[z] = ref.b[z];
change++;
}
cal.b[z] |= r1->calahead.b[z];
if(cal.b[z] != r1->calahead.b[z]) {
r1->calahead.b[z] = cal.b[z];
change++;
}
}
switch(r1->f.prog->as) {
case ACALL:
if(noreturn(r1->f.prog))
break;
for(z=0; z<BITS; z++) {
cal.b[z] |= ref.b[z] | externs.b[z];
ref.b[z] = 0;
}
break;
case ATEXT:
for(z=0; z<BITS; z++) {
cal.b[z] = 0;
ref.b[z] = 0;
}
break;
case ARET:
for(z=0; z<BITS; z++) {
cal.b[z] = externs.b[z] | ovar.b[z];
ref.b[z] = 0;
}
break;
default:
// Work around for issue 1304:
// flush modified globals before each instruction.
for(z=0; z<BITS; z++) {
cal.b[z] |= externs.b[z];
// issue 4066: flush modified return variables in case of panic
if(hasdefer)
cal.b[z] |= ovar.b[z];
}
break;
}
for(z=0; z<BITS; z++) {
ref.b[z] = (ref.b[z] & ~r1->set.b[z]) |
r1->use1.b[z] | r1->use2.b[z];
cal.b[z] &= ~(r1->set.b[z] | r1->use1.b[z] | r1->use2.b[z]);
r1->refbehind.b[z] = ref.b[z];
r1->calbehind.b[z] = cal.b[z];
}
if(r1->f.active)
break;
r1->f.active = 1;
}
for(; r != r1; r = (Reg*)r->f.p1)
for(r2 = (Reg*)r->f.p2; r2 != R; r2 = (Reg*)r2->f.p2link)
prop(r2, r->refbehind, r->calbehind);
}
示例4: prop
void VCMatrix::editProperties()
{
VCMatrixProperties prop(this, m_doc);
if (prop.exec() == QDialog::Accepted)
m_doc->setModified();
}
示例5: regopt
//.........这里部分代码省略.........
loopit(firstr, npc);
if(debug['R'] && debug['v']) {
print("\nlooping structure:\n");
for(r = firstr; r != R; r = r->link) {
print("%ld:%P", r->loop, r->prog);
for(z=0; z<BITS; z++)
bit.b[z] = r->use1.b[z] |
r->use2.b[z] |
r->set.b[z];
if(bany(&bit)) {
print("\t");
if(bany(&r->use1))
print(" u1=%B", r->use1);
if(bany(&r->use2))
print(" u2=%B", r->use2);
if(bany(&r->set))
print(" st=%B", r->set);
}
print("\n");
}
}
/*
* pass 3
* iterate propagating usage
* back until flow graph is complete
*/
loop1:
change = 0;
for(r = firstr; r != R; r = r->link)
r->active = 0;
for(r = firstr; r != R; r = r->link)
if(r->prog->as == ARET)
prop(r, zbits, zbits);
loop11:
/* pick up unreachable code */
i = 0;
for(r = firstr; r != R; r = r1) {
r1 = r->link;
if(r1 && r1->active && !r->active) {
prop(r, zbits, zbits);
i = 1;
}
}
if(i)
goto loop11;
if(change)
goto loop1;
/*
* pass 4
* iterate propagating register/variable synchrony
* forward until graph is complete
*/
loop2:
change = 0;
for(r = firstr; r != R; r = r->link)
r->active = 0;
synch(firstr, zbits);
if(change)
goto loop2;
/*
* pass 5
示例6: main
int main( int argc, char *argv[] ) {
// Init controller db file for backend
Q_INIT_RESOURCE( controllerdb );
// Uncomment this to enable the message handler for debugging and stack tracing
// qInstallMessageHandler( phoenixDebugMessageHandler );
// Handles stuff with the windowing system
QGuiApplication app( argc, argv );
// The engine that runs our QML-based UI
QQmlApplicationEngine engine;
// Set application metadata
QGuiApplication::setApplicationDisplayName( QStringLiteral( "Phoenix" ) );
QGuiApplication::setApplicationName( QStringLiteral( "Phoenix" ) );
QGuiApplication::setApplicationVersion( QStringLiteral( "0.0.1" ) );
QGuiApplication::setOrganizationName( QStringLiteral( "Team Phoenix" ) );
QGuiApplication::setOrganizationDomain( QStringLiteral( "phoenix.vg" ) );
// Figure out the right paths for the environment, and create user storage folders if not already there
Library::PhxPaths::initPaths();
// For release builds, write to a log file along with the console
#ifdef QT_NO_DEBUG
QFile logFile( Library::PhxPaths::userDataLocation() % '/' % QStringLiteral( "Logs" ) % '/' %
QDateTime::currentDateTime().toString( QStringLiteral( "ddd MMM d yyyy - h mm ss AP" ) ) %
QStringLiteral( ".log" ) );
// If this fails... how would we know? :)
logFile.open( QIODevice::WriteOnly | QIODevice::Text );
int logFD = logFile.handle();
logFP = fdopen( dup( logFD ), "w" );
qInstallMessageHandler( phoenixDebugMessageLog );
#endif
// Open connections to the SQL databases.
Library::LibretroDatabase::open();
Library::MetaDataDatabase::open();
// Necessary to quit properly
QObject::connect( &engine, &QQmlApplicationEngine::quit, &app, &QGuiApplication::quit );
// Register our custom types for use within QML
VideoItem::registerTypes();
InputManager::registerTypes();
// Register our custom QML-accessable/instantiable objects
qmlRegisterType<Library::PlatformsModel>( "vg.phoenix.models", 1, 0, "PlatformsModel" );
qmlRegisterType<Library::CollectionsModel>( "vg.phoenix.models", 1, 0, "CollectionsModel" );
qmlRegisterType<Library::LibraryModel>( "vg.phoenix.models", 1, 0, "LibraryModel" );
qmlRegisterType<Library::CoreModel>( "vg.phoenix.models", 1, 0, "CoreModel" );
qmlRegisterType<Library::ImageCacher>( "vg.phoenix.cache", 1, 0, "ImageCacher" );
qmlRegisterType<GameLauncher>( "vg.phoenix.launcher", 1, 0, "GameLauncher" );
// Register our custom QML-accessable objects and instantiate them here
qmlRegisterSingletonType( QUrl( "qrc:/PhxTheme.qml" ), "vg.phoenix.themes", 1, 0, "PhxTheme" );
qmlRegisterSingletonType<Library::PhxPaths>( "vg.phoenix.paths", 1, 0, "PhxPaths", PhxPathsSingletonProviderCallback );
qRegisterMetaType<Library::GameData>( "GameData" );
// Load the root QML object and everything under it
engine.load( QUrl( QStringLiteral( "qrc:/main.qml" ) ) );
// Ensure custom controller DB file exists
QFile gameControllerDBFile( Library::PhxPaths::userDataLocation() % '/' % QStringLiteral( "gamecontrollerdb.txt" ) );
if( !gameControllerDBFile.exists() ) {
gameControllerDBFile.open( QIODevice::ReadWrite );
QTextStream stream( &gameControllerDBFile );
stream << "# Insert your custom definitions here" << endl;
gameControllerDBFile.close();
}
// Set InputManager's custom controller DB file
QQmlProperty prop( engine.rootObjects().first(), "inputManager.controllerDBFile" );
Q_ASSERT( prop.isValid() );
QString path = Library::PhxPaths::userDataLocation() % QStringLiteral( "/gamecontrollerdb.txt" );
QVariant pathVar( path );
prop.write( pathVar );
// Run the app and write return code to the log file if in release mode
#ifdef QT_NO_DEBUG
int ret = app.exec();
fprintf( logFP, "Returned %d", ret );
fclose( logFP );
return ret;
#else
// Otherwise, just run it normally
return app.exec();
#endif
}
示例7: prop
QString ItemRDFImpl::commentPostUri() const
{
PropertyPtr prop(new Property(commentApiNamespace() + QLatin1String("comment")));
return m_item.resource()->property(prop)->asString();
}
示例8: Q_ASSERT
QObject *QDeclarativeVME::run(QDeclarativeVMEObjectStack &stack,
QDeclarativeContextData *ctxt,
QDeclarativeCompiledData *comp,
int start, int count,
const QBitField &bindingSkipList)
{
Q_ASSERT(comp);
Q_ASSERT(ctxt);
const QList<QDeclarativeCompiledData::TypeReference> &types = comp->types;
const QList<QString> &primitives = comp->primitives;
const QList<QByteArray> &datas = comp->datas;
const QList<QDeclarativeCompiledData::CustomTypeData> &customTypeData = comp->customTypeData;
const QList<int> &intData = comp->intData;
const QList<float> &floatData = comp->floatData;
const QList<QDeclarativePropertyCache *> &propertyCaches = comp->propertyCaches;
const QList<QDeclarativeParser::Object::ScriptBlock> &scripts = comp->scripts;
const QList<QUrl> &urls = comp->urls;
QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding> bindValues;
QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus> parserStatus;
QDeclarativeVMEStack<ListInstance> qliststack;
vmeErrors.clear();
QDeclarativeEnginePrivate *ep = QDeclarativeEnginePrivate::get(ctxt->engine);
int status = -1; //for dbus
QDeclarativePropertyPrivate::WriteFlags flags = QDeclarativePropertyPrivate::BypassInterceptor |
QDeclarativePropertyPrivate::RemoveBindingOnAliasWrite;
for (int ii = start; !isError() && ii < (start + count); ++ii) {
const QDeclarativeInstruction &instr = comp->bytecode.at(ii);
switch(instr.type) {
case QDeclarativeInstruction::Init:
{
if (instr.init.bindingsSize)
bindValues = QDeclarativeEnginePrivate::SimpleList<QDeclarativeAbstractBinding>(instr.init.bindingsSize);
if (instr.init.parserStatusSize)
parserStatus = QDeclarativeEnginePrivate::SimpleList<QDeclarativeParserStatus>(instr.init.parserStatusSize);
if (instr.init.contextCache != -1)
ctxt->setIdPropertyData(comp->contextCaches.at(instr.init.contextCache));
if (instr.init.compiledBinding != -1)
ctxt->optimizedBindings = new QDeclarativeCompiledBindings(datas.at(instr.init.compiledBinding).constData(), ctxt, comp);
}
break;
case QDeclarativeInstruction::CreateObject:
{
QBitField bindings;
if (instr.create.bindingBits != -1) {
const QByteArray &bits = datas.at(instr.create.bindingBits);
bindings = QBitField((const quint32*)bits.constData(),
bits.size() * 8);
}
if (stack.isEmpty())
bindings = bindings.united(bindingSkipList);
QObject *o =
types.at(instr.create.type).createInstance(ctxt, bindings, &vmeErrors);
if (!o) {
VME_EXCEPTION(QCoreApplication::translate("QDeclarativeVME","Unable to create object of type %1").arg(QString::fromLatin1(types.at(instr.create.type).className)));
}
QDeclarativeData *ddata = QDeclarativeData::get(o);
Q_ASSERT(ddata);
if (stack.isEmpty()) {
if (ddata->context) {
Q_ASSERT(ddata->context != ctxt);
Q_ASSERT(ddata->outerContext);
Q_ASSERT(ddata->outerContext != ctxt);
QDeclarativeContextData *c = ddata->context;
while (c->linkedContext) c = c->linkedContext;
c->linkedContext = ctxt;
} else {
ctxt->addObject(o);
}
ddata->ownContext = true;
} else if (!ddata->context) {
ctxt->addObject(o);
}
ddata->setImplicitDestructible();
ddata->outerContext = ctxt;
ddata->lineNumber = instr.line;
ddata->columnNumber = instr.create.column;
if (instr.create.data != -1) {
QDeclarativeCustomParser *customParser =
types.at(instr.create.type).type->customParser();
customParser->setCustomData(o, datas.at(instr.create.data));
}
if (!stack.isEmpty()) {
QObject *parent = stack.top();
if (o->isWidgetType()) {
QWidget *widget = static_cast<QWidget*>(o);
if (parent->isWidgetType()) {
//.........这里部分代码省略.........
示例9: regopt
//.........这里部分代码省略.........
}
r->s2 = r1;
r->p2link = r1->p2;
r1->p2 = r;
}
}
if(debug['R'] && debug['v'])
dumpit("pass2", firstr);
/*
* pass 2.5
* find looping structure
*/
for(r = firstr; r != R; r = r->link)
r->active = 0;
change = 0;
loopit(firstr, nr);
if(debug['R'] && debug['v'])
dumpit("pass2.5", firstr);
/*
* pass 3
* iterate propagating usage
* back until flow graph is complete
*/
loop1:
change = 0;
for(r = firstr; r != R; r = r->link)
r->active = 0;
for(r = firstr; r != R; r = r->link)
if(r->prog->as == ARET)
prop(r, zbits, zbits);
loop11:
/* pick up unreachable code */
i = 0;
for(r = firstr; r != R; r = r1) {
r1 = r->link;
if(r1 && r1->active && !r->active) {
prop(r, zbits, zbits);
i = 1;
}
}
if(i)
goto loop11;
if(change)
goto loop1;
if(debug['R'] && debug['v'])
dumpit("pass3", firstr);
/*
* pass 4
* iterate propagating register/variable synchrony
* forward until graph is complete
*/
loop2:
change = 0;
for(r = firstr; r != R; r = r->link)
r->active = 0;
synch(firstr, zbits);
if(change)
goto loop2;
if(debug['R'] && debug['v'])
示例10: switch
void ShapeCL::update(int id)
{
switch (id)
{
case PROP_STENCIL:
{
if (prop(id) < 0.0) setProperty(id, 0.0);
else if (prop(id) > 3.0) setProperty(id, 3.0);
break;
}
case PROP_BLINK_FREQ:
{
if (prop(id) < 0.0)
{
setProperty(id, 0.0);
bBlinkOn = 1;
dBlinkClock = 0.0;
}
break;
}
// numbers between 0.0 and 1.0:
case PROP_BLINK_DUTY_CYCLE:
case PROP_BLINK_INITIAL_PHASE:
{
if (prop(id) < 0.0)
setProperty(id, 0.0);
else if (prop(id) > 1.0)
setProperty(id, 1.0);
break;
}
// properties that must be >= 0.0
case PROP_RAMP_REPEAT:
case PROP_RAMP_PERIOD:
{
if (prop(id) < 0.0)
setProperty(id, 0.0);
break;
}
// allow least sig 8 bits to be set, bit n [1..8] on
// means turn stimulus on for block n
case PROP_BLOCK:
{
if (prop(id) < 0)
setProperty(id, 0);
else if (prop(id) > 255)
setProperty(id, 255);
break;
}
// properties that should be integers in range [1..3]:
case PROP_EYE:
{
if (prop(id) < 1)
setProperty(id, 3);
else if (prop(id) > 3)
setProperty(id, 1);
break;
}
// properties than can be 0 or 1 or 2
case PROP_RAMPED:
{
if (prop(id) < 0)
setProperty(id, 2);
else if (prop(id) > 2)
setProperty(id, 0);
break;
}
// properties that are 0 or 1 (e.g. on/off properties)
case PROP_ALWAYS_ON:
case PROP_RAMP_UPORDOWN:
case PROP_COLOR_TRACK_BG:
{
if (prop(id) < 0)
setProperty(id, 1);
else if (prop(id) > 1)
setProperty(id, 0);
break;
}
case PROP_RED:
case PROP_GREEN:
case PROP_BLUE:
{
for (int i=PROP_RED; i<=PROP_BLUE; i++)
{
if (prop(i) < 0)
setProperty(i, 0);
else if (prop(i) > 255)
setProperty(i, 255);
fRGBA[i-PROP_RED] = prop(i) / 255.0;
}
break;
}
}
}
示例11: prop
void ShapeCL::updateAt(double seconds)
{
if (prop(PROP_BLINK_FREQ) > 0.0)
{
dBlinkClock += seconds;
double period = 1.0/prop(PROP_BLINK_FREQ);
if (dBlinkClock > period)
{
dBlinkClock -= period;
}
bBlinkOn = 1;
if (dBlinkClock > period*prop(PROP_BLINK_DUTY_CYCLE))
bBlinkOn = 0;
}
if (prop(PROP_RAMP_REPEAT) > 0.0)
{
dRampClock += seconds;
if (dRampClock > prop(PROP_RAMP_REPEAT))
{
dRampClock -= prop(PROP_RAMP_REPEAT);
}
if (prop(PROP_RAMP_UPORDOWN) == 0)
{
if (prop(PROP_RAMP_PERIOD) > 0.0 && dRampClock < prop(PROP_RAMP_PERIOD))
setOpacity(dRampClock / prop(PROP_RAMP_PERIOD));
else
setOpacity(1.0);
}
else
{
if (prop(PROP_RAMP_PERIOD) > 0.0 && dRampClock < prop(PROP_RAMP_PERIOD))
setOpacity(1.0 - dRampClock / prop(PROP_RAMP_PERIOD));
else
setOpacity(0.0);
}
}
}
示例12: dumpId
char *OpenDDLParser::parseHeader( char *in, char *end ) {
if( ddl_nullptr == in || in == end ) {
return in;
}
Text *id( ddl_nullptr );
in = OpenDDLParser::parseIdentifier( in, end, &id );
#ifdef DEBUG_HEADER_NAME
dumpId( id );
#endif // DEBUG_HEADER_NAME
in = lookForNextToken( in, end );
if( ddl_nullptr != id ) {
// store the node
DDLNode *node( createDDLNode( id, this ) );
if( ddl_nullptr != node ) {
pushNode( node );
} else {
std::cerr << "nullptr returned by creating DDLNode." << std::endl;
}
delete id;
Name *name(ddl_nullptr);
in = OpenDDLParser::parseName(in, end, &name);
if( ddl_nullptr != name && ddl_nullptr != node ) {
const std::string nodeName( name->m_id->m_buffer );
node->setName( nodeName );
delete name;
}
Property *first(ddl_nullptr);
in = lookForNextToken(in, end);
if (*in == Grammar::OpenPropertyToken[0]) {
in++;
Property *prop(ddl_nullptr), *prev(ddl_nullptr);
while (*in != Grammar::ClosePropertyToken[0] && in != end) {
in = OpenDDLParser::parseProperty(in, end, &prop);
in = lookForNextToken(in, end);
if (*in != Grammar::CommaSeparator[0] && *in != Grammar::ClosePropertyToken[0]) {
logInvalidTokenError(in, Grammar::ClosePropertyToken, m_logCallback);
return ddl_nullptr;
}
if (ddl_nullptr != prop && *in != Grammar::CommaSeparator[0]) {
if (ddl_nullptr == first) {
first = prop;
}
if (ddl_nullptr != prev) {
prev->m_next = prop;
}
prev = prop;
}
}
++in;
}
// set the properties
if (ddl_nullptr != first && ddl_nullptr != node) {
node->setProperties(first);
}
}
return in;
}
示例13: abstract_commutation
bool abstract_commutation(
const locst &locs,
impara_var_mapt &var_map,
node_reft current,
node_reft ancestor,
node_reft mover)
{
const namespacet &ns=var_map.ns;
std::cout << "<<<<<<<<<<<<<<<<<<<<" << std::endl;
std::cout << "abstract_commutation current " << current->number
<< " ancestor " << ancestor->number
<< " mover " << mover->number << std::endl;
for(; !ancestor.is_nil() && !ancestor->has_label();--ancestor);
propagationt prop(ns);
// turn A into a history
propagationt propagation_mover(
ns,
mover->history,
ancestor);
propagation_mover.set_hidden(true);
std::set<exprt> mover_reads, mover_writes;
cone_of_influence(locs, var_map, propagation_mover, mover, ancestor, mover_reads, mover_writes);
// split B into VCs
propagationt propagation_current(
ns,
current->history,
ancestor);
propagation_current.set_hidden(true);
std::set<exprt> current_reads, current_writes;
cone_of_influence(locs, var_map, propagation_current, current, ancestor, current_reads, current_writes);
bool dependence=shared_stept::intersect(current_reads, mover_writes)
|| shared_stept::intersect(current_writes, mover_reads)
|| shared_stept::intersect(current_writes, mover_writes);
#ifdef DEBUG
std::cout << "sensitivity checker VCs" << std::endl;
/*
for(unsigned i=0; i<vcs.size(); ++i)
{
std::cout << vcs[i].pretty(ns, locs) << std::endl;
}
*/
if(dependence)
{
std::cout << "Dependent"<<std::endl;
}
else
{
std::cout << "Independent"<<std::endl;
}
shared_stept::output(mover_reads, mover_writes,std::cout);
shared_stept::output(current_reads, current_writes,std::cout);
#endif
return !dependence;
}
示例14: prop
void VCSlider::editProperties()
{
VCSliderProperties prop(_app, this);
if (prop.exec() == QDialog::Accepted)
_app->doc()->setModified();
}
示例15: doc
bool xmlImport::importProps() {
TiXmlDocument doc(xmlFile.c_str());
if(!doc.LoadFile()){
Logger::getLogger()->debug("Error: could not load properties XML file");
return false;
}
TiXmlElement* pElem;
TiXmlElement* pChild;
TiXmlHandle hDoc(&doc);
TiXmlHandle hRoot(0);
DesignStore::Ptr ds = Game::getGame()->getDesignStore();
int count=0; // item count
pElem = hDoc.FirstChildElement("properties").Element();
if(!pElem) return false;
hRoot = TiXmlHandle(pElem);
for(pElem=hRoot.FirstChild("prop").Element(); pElem != NULL;
pElem = pElem->NextSiblingElement())
{
TiXmlElement* pCur = 0;
std::string propName, propDisplayName, propDescription, propTpclDisplay,
propTpclRequirement, propIDName;
int propRank;
std::map<uint32_t, std::string> propertylist;
pChild = hRoot.Child("prop",count).Element();
//debug: cout << "count: " << count << endl;
if(pChild) {
//read and set the name of the property
pCur = pChild->FirstChildElement("name");
if (pCur) {
propName = pCur->GetText();
if (propName.empty()) return false;
} else {
return false;
}
//read and set the name of the property
pCur = pChild->FirstChildElement("displayName");
if (pCur) {
propDisplayName = pCur->GetText();
if (propDisplayName.empty()) return false;
} else {
return false;
}
//read and set the ID of the property
pCur = pChild->FirstChildElement("PropertyIDName");
if (pCur) {
propIDName = pCur->GetText();
if (propIDName.empty()) return false;
} else {
return false;
}
//read and set the rank of the property
pCur = pChild->FirstChildElement("rank");
if (pCur) {
if (pCur->QueryIntAttribute("value", &(propRank)) != TIXML_SUCCESS) {
return false;
}
}
//read and set the description of the property
pCur = pChild->FirstChildElement("description");
if (pCur) {
propDescription = pCur->GetText();
if (propDescription.empty()) return false;
} else {
return false;
}
//read and set the tpclDisplayFunction of the property
pCur = pChild->FirstChildElement("tpclDisplayFunction");
if (pCur) {
propTpclDisplay = pCur->GetText();
if (propTpclDisplay.empty()) return false;
} else {
return false;
}
//read and set the tpclRequirementsFunction of the property
pCur = pChild->FirstChildElement("tpclRequirementsFunction");
if (pCur) {
propTpclRequirement = pCur->GetText();
if (propTpclRequirement.empty()) return false;
} else {
return false;
}
//do the property
Property::Ptr prop( new Property() );
prop->addCategoryId(ds->getCategoryByName(propIDName));
prop->setRank((uint32_t)propRank);
prop->setName(propName);
prop->setDisplayName(propDisplayName);
prop->setDescription(propDescription);
prop->setTpclDisplayFunction(propTpclDisplay);
prop->setTpclRequirementsFunction(propTpclRequirement);
ds->addProperty(prop);
//.........这里部分代码省略.........