本文整理汇总了C++中py::Tuple::front方法的典型用法代码示例。如果您正苦于以下问题:C++ Tuple::front方法的具体用法?C++ Tuple::front怎么用?C++ Tuple::front使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类py::Tuple
的用法示例。
在下文中一共展示了Tuple::front方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TypeError
CyPy_MemEntity::CyPy_MemEntity(Py::PythonClassInstanceWeak* self, Py::Tuple& args, Py::Dict& kwds)
: CyPy_LocatedEntityBase(self, args, kwds)
{
args.verify_length(1);
auto arg = args.front();
if (arg.isString()) {
auto id = verifyString(args.front());
long intId = integerId(id);
if (intId == -1L) {
throw Py::TypeError("MemEntity() requires string/int ID");
}
m_value = new MemEntity(id, intId);
} else if (CyPy_MemEntity::check(arg)) {
m_value = CyPy_MemEntity::value(arg);
} else {
throw Py::TypeError("MemEntity() requires string ID or MemEntity");
}
}
示例2: irrelevant
Py::Object CyPy_Task::irrelevant(const Py::Tuple& args)
{
m_value->irrelevant();
if (args.size() > 0) {
args.verify_length(1);
Atlas::Objects::Operation::Error e;
Atlas::Objects::Entity::Anonymous arg;
arg->setAttr("message", verifyString(args.front()));
e->modifyArgs().push_back(arg);
e->setTo(m_value->m_usageInstance.actor->getId());
return CyPy_Operation::wrap(e);
}
return Py::None();
}
示例3: add_properties
Py::Object add_properties(const Py::Tuple& args)
{
auto ent = CyPy_Entity::value(args.front());
PropertyBase * p = ent->setProperty("statistics", new StatisticsProperty);
p->install(ent.get(), "statistics");
p->apply(ent.get());
ent->propertyApplied("statistics", *p);
p = ent->setProperty("terrain", new TerrainProperty);
p->install(ent.get(), "terrain");
p->apply(ent.get());
ent->propertyApplied("terrain", *p);
p = ent->setProperty("line", new LineProperty);
p->install(ent.get(), "line");
p->apply(ent.get());
ent->propertyApplied("line", *p);
return Py::None();
}
示例4: TypeError
CyPy_Task::CyPy_Task(Py::PythonClassInstance* self, Py::Tuple& args, Py::Dict& kwds)
: WrapperBase(self, args, kwds)
{
args.verify_length(1);
auto arg = args.front();
if (CyPy_Task::check(arg)) {
m_value = CyPy_Task::value(arg);
} else if (CyPy_UsageInstance::check(arg)) {
m_value = new Task(CyPy_UsageInstance::value(arg), this->self());
} else {
throw Py::TypeError("Task requires a Task, or UsageInstance");
}
for (auto entry : kwds) {
if (entry.first.isString()) {
setattro(entry.first.as_string(), entry.second);
}
}
}
示例5: is_now
Py::Object CyPy_WorldTime::is_now(const Py::Tuple& args)
{
args.verify_length(1);
return Py::Boolean(get_value() == verifyString(args.front()));
}
示例6: WrapperBase
CyPy_WorldTime::CyPy_WorldTime(Py::PythonClassInstance* self, Py::Tuple& args, Py::Dict& kwds)
: WrapperBase(self, args, kwds)
{
args.verify_length(1);
m_value = std::make_shared<WorldTime>(verifyLong(args.front()));
}