本文整理汇总了C++中Objects类的典型用法代码示例。如果您正苦于以下问题:C++ Objects类的具体用法?C++ Objects怎么用?C++ Objects使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Objects类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Objects
void AggregateDeclaration::semantic3(Scope *sc)
{
//printf("AggregateDeclaration::semantic3(%s)\n", toChars());
if (members)
{
sc = sc->push(this);
for (size_t i = 0; i < members->dim; i++)
{
Dsymbol *s = (*members)[i];
s->semantic3(sc);
}
sc->pop();
if (!getRTInfo)
{ // Evaluate: gcinfo!type
Objects *tiargs = new Objects();
tiargs->push(type);
TemplateInstance *ti = new TemplateInstance(loc, Type::rtinfo, tiargs);
ti->semantic(sc);
ti->semantic2(sc);
ti->semantic3(sc);
Dsymbol *s = ti->toAlias();
Expression *e = new DsymbolExp(0, s, 0);
e = e->semantic(ti->tempdecl->scope);
e = e->ctfeInterpret();
getRTInfo = e;
}
}
}
示例2: detect
/* -----------------------------------------------------------------------------
* Detection (FAKE)
*/
void SampleDetector::detect( const Mat& rgb, const Mat& depth, Objects& objects, int FLAGS )
{
objects.clear();
// Set a bounding box of a FAKE detection
Object detection;
detection.m_bb.x = 100 + (rand() % 20);
detection.m_bb.y = 100 + (rand() % 20);
detection.m_bb.width = 100 + (rand() % 5);
detection.m_bb.height = 100 + (rand() % 5);
detection.m_pos_2D.x = detection.m_bb.x + (detection.m_bb.width / 2);
detection.m_pos_2D.y = detection.m_bb.y + (detection.m_bb.height / 2);
detection.m_class = unknown;
detection.m_score = 0;
detection.m_angle = 0;
detection.m_mask = Mat(cvSize(0, 0), CV_8U);
detection.m_timestamp = 0;
detection.m_speed = cv::Point3f(0,0,0);
objects.push_back(detection);
}
示例3: isStructDeclaration
void AggregateDeclaration::semantic3(Scope *sc)
{
//printf("AggregateDeclaration::semantic3(%s) type = %s, errors = %d\n", toChars(), type->toChars(), errors);
if (!members)
return;
StructDeclaration *sd = isStructDeclaration();
if (!sc) // from runDeferredSemantic3 for TypeInfo generation
{
assert(sd);
sd->semanticTypeInfoMembers();
return;
}
Scope *sc2 = sc->push(this);
sc2->stc &= STCsafe | STCtrusted | STCsystem;
sc2->parent = this;
if (isUnionDeclaration())
sc2->inunion = 1;
sc2->protection = Prot(PROTpublic);
sc2->explicitProtection = 0;
sc2->structalign = STRUCTALIGN_DEFAULT;
sc2->userAttribDecl = NULL;
for (size_t i = 0; i < members->dim; i++)
{
Dsymbol *s = (*members)[i];
s->semantic3(sc2);
}
sc2->pop();
// don't do it for unused deprecated types
// or error types
if (!getRTInfo && Type::rtinfo &&
(!isDeprecated() || global.params.useDeprecated) &&
(type && type->ty != Terror))
{
// Evaluate: RTinfo!type
Objects *tiargs = new Objects();
tiargs->push(type);
TemplateInstance *ti = new TemplateInstance(loc, Type::rtinfo, tiargs);
ti->semantic(sc);
ti->semantic2(sc);
ti->semantic3(sc);
Dsymbol *s = ti->toAlias();
Expression *e = new DsymbolExp(Loc(), s, 0);
Scope *sc3 = ti->tempdecl->scope->startCTFE();
sc3->tinst = sc->tinst;
e = e->semantic(sc3);
sc3->endCTFE();
e = e->ctfeInterpret();
getRTInfo = e;
}
if (sd)
sd->semanticTypeInfoMembers();
}
示例4: switch
/*******************************************
* Helper function to turn operator into template argument list
*/
Objects *opToArg(Scope *sc, enum TOK op)
{
/* Remove the = from op=
*/
switch (op)
{
case TOKaddass: op = TOKadd; break;
case TOKminass: op = TOKmin; break;
case TOKmulass: op = TOKmul; break;
case TOKdivass: op = TOKdiv; break;
case TOKmodass: op = TOKmod; break;
case TOKandass: op = TOKand; break;
case TOKorass: op = TOKor; break;
case TOKxorass: op = TOKxor; break;
case TOKshlass: op = TOKshl; break;
case TOKshrass: op = TOKshr; break;
case TOKushrass: op = TOKushr; break;
case TOKcatass: op = TOKcat; break;
case TOKpowass: op = TOKpow; break;
}
Expression *e = new StringExp(0, (char *)Token::toChars(op));
e = e->semantic(sc);
Objects *targsi = new Objects();
targsi->push(e);
return targsi;
}
示例5: instances
Objects
instances(World* world, const URISet& types)
{
LilvNode* rdf_type = lilv_new_uri(
world->lilv_world(), LILV_NS_RDF "type");
Objects result;
for (const auto& t : types) {
LilvNode* type = lilv_new_uri(world->lilv_world(), t.c_str());
LilvNodes* objects = lilv_world_find_nodes(
world->lilv_world(), NULL, rdf_type, type);
LILV_FOREACH(nodes, o, objects) {
const LilvNode* object = lilv_nodes_get(objects, o);
if (!lilv_node_is_uri(object)) {
continue;
}
const std::string label = RDFS::label(world, object);
result.insert(
std::make_pair(label,
Raul::URI(lilv_node_as_string(object))));
}
lilv_node_free(type);
}
lilv_node_free(rdf_type);
return result;
}
示例6:
void
ObjectDeleteCommandImpl::execute()
{
for(Objects::iterator i = objects.begin(); i != objects.end(); ++i)
{
object_layer.delete_object(*i);
}
}
示例7:
void
ObjectMoveCommandImpl::undo()
{
for(ObjectMoveCommandImpl::Objects::iterator i = objects.begin();
i != objects.end();
++i)
{
i->obj.set_pos(i->old_pos);
}
}
示例8: getOrderedObjects
void SEQFile::clearAnims() {
Objects objects = getOrderedObjects();
// Remove the animation frames, in reverse drawing order
for (Objects::iterator o = objects.legacy_reverse_begin(); o != objects.end(); --o) {
int16 left, top, right, bottom;
if (o->object->clear(*_vm->_draw->_backSurface, left, top, right, bottom))
_vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
}
}
示例9: drawCalibratedObjects
void drawCalibratedObjects(gluit::Graphics& g) const
{
Objects transformed = objects;
for (Objects::Iterator object = transformed.begin(); object != transformed.end(); ++object) {
(*object)->transform(*transformer);
gluit::Point position = convert((*object)->getPosition());
g.setColor(0xFF6666CC);
g.drawEllipse(gluit::Rectangle(gluit::Size(40)).centerOn(position), true);
}
}
示例10: clear
void Frame::drawAll()
{
clear(sf::Color::Black);
Objects toDraw = objectsInBounds(sf::FloatRect(sf::Vector2f(0,0),_bounds));
Objects::iterator it = toDraw.begin();
for(;it != toDraw.end();it++)
{
(*it)->onDisplay();
draw(*(*it)->getDrawable());
}
display();
}
示例11: add
// called in Stored constructor
// assignes new unique ID and back iterator
virtual ID add(Target * object)
{
assert(generator);
if(!valid(object->id()))
object->localID=generator->generate(object);
else if(contains(object->id()))
{
assert(false);
}
objects.insert(std::make_pair(object->id(),object));
Objects::iterator it=objects.find(object->id());
object->back=it;
onAdd(object); // raise onAdd event.
return object->id();
}
示例12: clear
void clear()
{
for(typename Objects::reverse_iterator i = objects.rbegin(); i != objects.rend(); ++i)
(*i)->~T();
objects.clear();
// FIXME: We don't have to delete the chunks, instead we should
// just reset the pointer to start and reuse them
for(typename Chunks::reverse_iterator i = chunks.rbegin(); i != chunks.rend(); ++i)
{
delete[] *i;
}
chunks.clear();
next_free = 0;
}
示例13:
ObjectLayer::Objects
ObjectLayer::get_selection(const CL_Rectf& rect)
{
Objects selection;
for(Objects::iterator i = impl->objects.begin(); i != impl->objects.end(); ++i)
{
// FIXME:
if (rect.is_inside((*i).get_pos()))
{
selection.push_back(*i);
}
}
return selection;
}
示例14: Print
void Print(std::ostream& stream)
{
std::vector<Objects::const_iterator> referencedObjects;
referencedObjects.reserve(links.size());
for(Links::const_iterator i = links.begin(); i != links.end(); ++i)
referencedObjects.push_back(i->second);
std::sort(referencedObjects.begin(), referencedObjects.end());
referencedObjects.resize(std::unique(referencedObjects.begin(), referencedObjects.end()) - referencedObjects.begin());
// пока просто вывести
for(Objects::const_iterator object = objects.begin(); object != objects.end(); ++object)
{
if(std::binary_search(referencedObjects.begin(), referencedObjects.end(), object))
continue;
Print(stream, object);
}
}
示例15: Objects
void AggregateDeclaration::semantic3(Scope *sc)
{
#if IN_LLVM
if (!global.inExtraInliningSemantic)
availableExternally = false;
#endif
//printf("AggregateDeclaration::semantic3(%s)\n", toChars());
if (members)
{
sc = sc->push(this);
sc->parent = this;
for (size_t i = 0; i < members->dim; i++)
{
Dsymbol *s = (*members)[i];
s->semantic3(sc);
}
if (StructDeclaration *sd = isStructDeclaration())
{
//if (sd->xeq != NULL) printf("sd = %s xeq @ [%s]\n", sd->toChars(), sd->loc.toChars());
//assert(sd->xeq == NULL);
if (sd->xeq == NULL)
sd->xeq = sd->buildXopEquals(sc);
}
sc = sc->pop();
if (!getRTInfo && Type::rtinfo &&
(!isDeprecated() || global.params.useDeprecated) && // don't do it for unused deprecated types
(type && type->ty != Terror)) // or error types
{ // Evaluate: gcinfo!type
Objects *tiargs = new Objects();
tiargs->push(type);
TemplateInstance *ti = new TemplateInstance(loc, Type::rtinfo, tiargs);
ti->semantic(sc);
ti->semantic2(sc);
ti->semantic3(sc);
Dsymbol *s = ti->toAlias();
Expression *e = new DsymbolExp(Loc(), s, 0);
e = e->ctfeSemantic(ti->tempdecl->scope);
e = e->ctfeInterpret();
getRTInfo = e;
}
}
}