Exemple #1
0
void BLI_argsAddCase(struct bArgs *ba, int pass,
                     const char *short_arg, int short_case,
                     const char *long_arg, int long_case,
                     const char *doc, BA_ArgCallback cb, void *data)
{
	bArgDoc *d = internalDocs(ba, short_arg, long_arg, doc);

	if (short_arg)
		internalAdd(ba, short_arg, pass, short_case, cb, data, d);

	if (long_arg)
		internalAdd(ba, long_arg, pass, long_case, cb, data, d);


}
Exemple #2
0
void EntityList::add( const vector<Entity*> &e )
{
	for (auto x : e) 
	{
		internalAdd(x);	
	}
}
Exemple #3
0
void EntityList::add( initializer_list<Entity*> e )
{
	for (auto x : e) 
	{
		internalAdd(x);
	}
}
/**
   @param argc how many arguments to add
   @param argv the strings to add
   @param position the position to add the string at, a position less
   than 0 means to add at the end, if this number is greater than how
   many positions exist then it will also be added at the end
**/
AREXPORT void ArArgumentBuilder::addStrings(int argc, char **argv, 
					    int position)
{
  int i;
  if(position < 0)
  {
    // Don't try to use incremental positions, since the sequence would be out
    // of order, just keep using the same special "at-end" meaning of negative position
    // value
    for (i = 0; i < argc; i++)
      internalAdd(argv[i], position);
  }
  else
  {
    for (i = 0; i < argc; i++)
      internalAdd(argv[i], position + i);
  }
}
AREXPORT void ArArgumentBuilder::add(const char *str, ...)
{
  char buf[10000];
  va_list ptr;
  va_start(ptr, str);
  vsnprintf(buf, sizeof(buf), str, ptr);
  internalAdd(buf, -1);
  va_end(ptr);
}
Exemple #6
0
void Bigint::add(const Bigint& number)
{
	if(isPositive!=number.isPositive)
	{
		subtract(number);
		return;
	}
	internalAdd(number);
}
Exemple #7
0
IdType MetadataStream::add( std::shared_ptr< Metadata >& spMetadata )
{
    if( !this->getSchema(spMetadata->getDesc()->getSchemaName()) )
        VMF_EXCEPTION(vmf::NotFoundException, "Metadata schema is not in the stream");

    IdType id = nextId++;
    spMetadata->setId(id);
    internalAdd(spMetadata);
    addedIds.push_back(id);
    return id;
}
Exemple #8
0
IdType MetadataStream::add( std::shared_ptr< MetadataInternal >& spMetadataInternal)
{
    if( !this->getSchema(spMetadataInternal->getDesc()->getSchemaName()) )
	VMF_EXCEPTION(vmf::NotFoundException, "Metadata schema is not in the stream");

    IdType id = spMetadataInternal->getId();
    if(id != INVALID_ID)
    {
        if(this->getById(id) == nullptr)
        {
            if(nextId < id)
                nextId = id + 1;
        }
        else
            VMF_EXCEPTION(IncorrectParamException, "Metadata with such id is already in the stream");
    }
    else
    {
        id = nextId++;
        spMetadataInternal->setId(id);
    }
    internalAdd(spMetadataInternal);
    addedIds.push_back(id);

    if(!spMetadataInternal->vRefs.empty())
    {
        auto spItem = getById(id);
        for(auto ref = spMetadataInternal->vRefs.begin(); ref != spMetadataInternal->vRefs.end(); ref++)
        {
            auto referencedItem = getById(ref->first);
            if(referencedItem != nullptr)
                spItem->addReference(referencedItem, ref->second);
            else
                m_pendingReferences[ref->first].push_back(std::make_pair(id, ref->second));
        }
    }
    auto pendingReferences = m_pendingReferences[id];
    if(!pendingReferences.empty())
    {
        for(auto pendingId = pendingReferences.begin(); pendingId != pendingReferences.end(); pendingId++)
            getById(pendingId->first)->addReference(spMetadataInternal, pendingId->second);
        m_pendingReferences[id].clear();
        m_pendingReferences.erase(id);
    }

    return id;
}
/**
   @param str the string to add

   @param position the position to add the string at, a position less
   than 0 means to add at the end, if this number is greater than how
   many positions exist then it will also be added at the end
**/
AREXPORT void ArArgumentBuilder::addPlain(const char *str, int position)
{
  internalAdd(str, position);
}
Exemple #10
0
void EntityList::add( Entity *e )
{
	internalAdd( e );
}
void  LogicSystem::internalAdd(std::string identifier,int index){
	internalAdd(_assetManagerPtr->lookUpLogicPointer(identifier),index);
}
Exemple #12
0
 int add(const ObjType& u) {
   SET_NODE *sn = internalAdd(u);
   if (sn==0) return -1;                       // already a member
   assert(currentSize++<=maxSize);   
   return sn->idx;                            // new member
 }