예제 #1
0
 ~Rule()
 {
     delete filter_;
     typedef Commands::const_iterator It;
     for (It i = cmds_->begin(); i != cmds_->end(); ++i) {
         delete *i;
     }
     delete cmds_;
 }
예제 #2
0
void CommandMgr::ClearCommands()
{
    while (!commandTable.empty())
    {
        Commands::iterator itr = commandTable.begin();
        delete itr->second;
        commandTable.erase(itr);
    }
}
예제 #3
0
void VDDialogEditAccelerators::RefilterCommands(const char *pattern) {
	mFilteredCommands.clear();

	LBClear(IDC_AVAILCOMMANDS);

	Commands::const_iterator it(mAllCommands.begin()), itEnd(mAllCommands.end());
	for(; it != itEnd; ++it) {
		const VDAccelToCommandEntry& ent = **it;

		if (VDFileWildMatch(pattern, ent.mpName)) {
			const VDStringW s(VDTextAToW(ent.mpName));

			mFilteredCommands.push_back(&ent);
			LBAddString(IDC_AVAILCOMMANDS, s.c_str());
		}
	}

	LBSetSelectedIndex(IDC_AVAILCOMMANDS, 0);
}
예제 #4
0
    /** The command handler functions. */
    bool cmdGetItem( Command& command )
    {
        const QueueGetItemPacket* packet = command.get< QueueGetItemPacket >();
        Commands commands;
        queue.tryPop( packet->itemsRequested, commands );

        for( CommandsCIter i = commands.begin(); i != commands.end(); ++i )
        {
            Command* item = *i;
            ObjectPacket* reply = item->getModifiable< ObjectPacket >();
            reply->instanceID = packet->slaveInstanceID;
            command.getNode()->send( *reply );
            item->release();
        }

        if( packet->itemsRequested > commands.size( ))
        {
            QueueEmptyPacket reply( packet );
            command.getNode()->send( reply );
        }
        return true;
    }
 void redo() {
   for(Commands::const_iterator i = cmds.begin(); i != cmds.end(); ++i)
     (*i)->redo();
 }