本文整理汇总了C++中configitem::Ptr::GetDebugInfo方法的典型用法代码示例。如果您正苦于以下问题:C++ Ptr::GetDebugInfo方法的具体用法?C++ Ptr::GetDebugInfo怎么用?C++ Ptr::GetDebugInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类configitem::Ptr
的用法示例。
在下文中一共展示了Ptr::GetDebugInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ValidateItem
void ConfigType::ValidateItem(const ConfigItem::Ptr& item)
{
/* Don't validate abstract items. */
if (item->IsAbstract())
return;
Dictionary::Ptr attrs;
DebugInfo debugInfo;
String type, name;
{
ObjectLock olock(item);
attrs = item->GetProperties();
debugInfo = item->GetDebugInfo();
type = item->GetType();
name = item->GetName();
}
std::vector<String> locations;
locations.push_back("Object '" + name + "' (Type: '" + type + "') at " + debugInfo.Path + ":" + Convert::ToString(debugInfo.FirstLine));
std::vector<TypeRuleList::Ptr> ruleLists;
AddParentRules(ruleLists, GetSelf());
ruleLists.push_back(m_RuleList);
ValidateDictionary(attrs, ruleLists, locations);
}
示例2: NewObject
static inline Value NewObject(ScriptFrame& frame, bool abstract, const String& type, const String& name, const boost::shared_ptr<Expression>& filter,
const String& zone, const String& package, std::map<String, Expression *> *closedVars, const boost::shared_ptr<Expression>& expression, const DebugInfo& debugInfo = DebugInfo())
{
ConfigItemBuilder::Ptr item = new ConfigItemBuilder(debugInfo);
String checkName = name;
if (!abstract) {
Type::Ptr ptype = Type::GetByName(type);
NameComposer *nc = dynamic_cast<NameComposer *>(ptype.get());
if (nc)
checkName = nc->MakeName(name, Dictionary::Ptr());
}
if (!checkName.IsEmpty()) {
ConfigItem::Ptr oldItem = ConfigItem::GetObject(type, checkName);
if (oldItem) {
std::ostringstream msgbuf;
msgbuf << "Object '" << name << "' of type '" << type << "' re-defined: " << debugInfo << "; previous definition: " << oldItem->GetDebugInfo();
BOOST_THROW_EXCEPTION(ScriptError(msgbuf.str(), debugInfo));
}
}
item->SetType(type);
item->SetName(name);
item->AddExpression(new OwnedExpression(expression));
item->SetAbstract(abstract);
item->SetScope(EvaluateClosedVars(frame, closedVars));
item->SetZone(zone);
item->SetPackage(package);
item->SetFilter(filter);
item->Compile()->Register();
return Empty;
}