本文整理汇总了C++中Objects::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Objects::end方法的具体用法?C++ Objects::end怎么用?C++ Objects::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Objects
的用法示例。
在下文中一共展示了Objects::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set
/** \brief
Force the pointer for the object in store to be a specific pointer.
This can be useful for singleton values.
These usually must be removed from the store explicitly.
\pre No object with this value is already in the store.
*/
void set (std::shared_ptr <Value const> pointer) {
// The value must not be in the store yet.
assert (objects_.find (*pointer,
boost::hash <Value>(), EqualToWeakPtr()) == objects_.end());
objects_.insert (std::move (pointer));
}
示例2:
void
ObjectDeleteCommandImpl::execute()
{
for(Objects::iterator i = objects.begin(); i != objects.end(); ++i)
{
object_layer.delete_object(*i);
}
}
示例3:
void
ObjectMoveCommandImpl::undo()
{
for(ObjectMoveCommandImpl::Objects::iterator i = objects.begin();
i != objects.end();
++i)
{
i->obj.set_pos(i->old_pos);
}
}
示例4: clearAnims
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);
}
}
示例5: 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);
}
}
示例6: drawAll
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();
}
示例7: send
void TUIOSender::send(const Objects& objects)
{
Mutex::scoped_lock lock(mutex);
if (!socket) {
return;
}
try {
char buffer[OUTBOUND_PACKET_STREAM_BUFFER_SIZE];
osc::OutboundPacketStream p(buffer, OUTBOUND_PACKET_STREAM_BUFFER_SIZE);
p << osc::BeginBundleImmediate;
p << osc::BeginMessage(oscAddress.getValue().c_str()) << "source" << sourceId.get().c_str() << osc::EndMessage;
p << osc::BeginMessage(oscAddress.getValue().c_str());
p << "alive";
for (Objects::ConstIterator object = objects.begin(); object != objects.end(); ++object) {
if ((*object)->isAlive()) {
p << int((*object)->getId());
}
}
p << osc::EndMessage;
for (Objects::ConstIterator object = objects.begin(); object != objects.end(); ++object) {
if ((*object)->isAlive()) {
p << osc::BeginMessage(oscAddress.getValue().c_str()) << "set" << (*object) << osc::EndMessage;
}
}
p << osc::BeginMessage(oscAddress.getValue().c_str()) << "fseq" << int(frameSequenceNumber++) << osc::EndMessage;
p << osc::EndBundle;
socket->Send(p.Data(), p.Size());
} catch (osc::OutOfBufferMemoryException& e) {
LOG4CPLUS_ERROR(logger, "Sending objects failed, too many objects to send (" << objects.getSize() << ")");
}
}
示例8: drawAnims
void SEQFile::drawAnims() {
Objects objects = getOrderedObjects();
// Draw the animation frames and advance the animation
for (Objects::iterator o = objects.begin(); o != objects.end(); ++o) {
int16 left, top, right, bottom;
if (o->object->draw(*_vm->_draw->_backSurface, left, top, right, bottom))
_vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
o->object->advance();
}
}
示例9: newElement
// Rvalue reference.
std::shared_ptr <Value const> get (Value && value) {
auto existing = objects_.find (value,
boost::hash <Value>(), EqualToWeakPtr());
if (existing != objects_.end())
return existing->get();
// The value is not in the store yet; insert it.
auto sole = SoleType::construct (*this, std::move (value));
Pointer newElement (sole);
objects_.insert (std::move (newElement));
return sole;
}
示例10:
PtrTracer(const ManagedHeap& heap)
{
// сформировать список объектов
objects.reserve(heap.allocations.size());
for(Allocations::const_iterator i = heap.allocations.begin(); i != heap.allocations.end(); ++i)
objects.push_back(Object(i->first, i->second.size, i->second.info));
std::sort(objects.begin(), objects.end(), sorter);
// сформировать карту ссылок
for(Ptrs::const_iterator i = heap.ptrs.begin(); i != heap.ptrs.end(); ++i)
{
// найти объект, в котором содержится указатель
Objects::const_iterator j = std::upper_bound(objects.begin(), objects.end(), i->first, sorter);
if(j > objects.begin())
{
--j;
if((size_t)((char*)i->first - (char*)j->data) < j->size)
// да, указатель содержится в этом объекте
// получить объект, на который указывает указатель, и добавить ссылку
links.insert(std::make_pair(j, std::lower_bound(objects.begin(), objects.end(), i->second, sorter)));
}
}
}
示例11: 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);
}
}
示例12: handleSourceDataUpdate
void handleSourceDataUpdate(const Source<Objects>& source)
{
Objects::Mutex::scoped_lock lock(objects.mutex);
objects = source.get();
if (calibrating) {
for (Objects::Iterator object = objects.begin(); object != objects.end(); ++object) {
if ((*object)->isNew()) {
objectAdded(*object);
} else if ((*object)->isDead()) {
objectRemoved(*object);
} else {
objectUpdated(*object);
}
}
}
repaint();
}
示例13: end
void
Store::rename(const iterator top, const Raul::Path& new_path)
{
const Raul::Path old_path = top->first;
// Remove the object and all its descendants
Objects removed;
remove(top, removed);
// Rename all the removed objects
for (Objects::const_iterator i = removed.begin(); i != removed.end(); ++i) {
const Raul::Path path = (i->first == old_path)
? new_path
: new_path.child(
Raul::Path(i->first.substr(old_path.base().length() - 1)));
i->second->set_path(path);
assert(find(path) == end()); // Shouldn't be dropping objects!
insert(make_pair(path, i->second));
}
}
示例14: end
iterator end() { return objects.end(); }
示例15: contains
bool contains(ID id)
{
return objects.find(id)!=objects.end();
}