All pastes #163921 Raw Edit

CEL error

public text v1 · immutable
·published 2006-09-08 01:54 UTC
rendered paste body
C++ ./out/linuxx86/debug/plugins/stdphyslayer/entity.o 
plugins/stdphyslayer/entity.cpp: In constructor `celEntityList::Iterator::Iterator(const celEntityList*)':
plugins/stdphyslayer/entity.cpp:180: error: no matching function for call to `csArray<iCelEntity*, csRefArrayElementHandler<iCelEntity*>, CS::Memory::AllocatorMalloc, csArrayCapacityDefault>::Iterator::Iterator(csArray<iCelEntity*, csRefArrayElementHandler<iCelEntity*>, CS::Memory::AllocatorMalloc, csArrayCapacityDefault>::ConstIterator)'
/home/whitelynx/development/CS/include/csutil/array.h:1167: note: candidates are: csArray<T, ElementHandler, MemoryAllocator, CapacityHandler>::Iterator::Iterator(csArray<T, ElementHandler, CS::Memory::AllocatorMalloc, csArrayCapacityDefault>&) [with T = iCelEntity*, ElementHandler = csRefArrayElementHandler<iCelEntity*>, MemoryAllocator = CS::Memory::AllocatorMalloc, CapacityHandler = csArrayCapacityDefault]
/home/whitelynx/development/CS/include/csutil/array.h:1146: note:                 csArray<T, ElementHandler, MemoryAllocator, CapacityHandler>::Iterator::Iterator(const csArray<T, ElementHandler, MemoryAllocator, CapacityHandler>::Iterator&) [with T = iCelEntity*, ElementHandler = csRefArrayElementHandler<iCelEntity*>, MemoryAllocator = CS::Memory::AllocatorMalloc, CapacityHandler = csArrayCapacityDefault]
plugins/stdphyslayer/entity.cpp: In member function `virtual bool celEntityList::Iterator::HasNext() const':
plugins/stdphyslayer/entity.cpp:190: error: passing `const csArray<iCelEntity*, csRefArrayElementHandler<iCelEntity*>, CS::Memory::AllocatorMalloc, csArrayCapacityDefault>::Iterator' as `this' argument of `bool csArray<T, ElementHandler, MemoryAllocator, CapacityHandler>::Iterator::HasNext() [with T = iCelEntity*, ElementHandler = csRefArrayElementHandler<iCelEntity*>, MemoryAllocator = CS::Memory::AllocatorMalloc, CapacityHandler = csArrayCapacityDefault]' discards qualifiers

    g++ -c -o ./out/linuxx86/debug/plugins/stdphyslayer/entity.o -I. -I./include -I. -pipe -Wall -fvisibility=hidden -DPACKAGE_NAME=CEL -Wall -fvisibility-inlines-hidden -g3 -g3 -DCS_DEBUG -fPIC -I/home/whitelynx/development/CS/include  plugins/stdphyslayer/entity.cpp

...failed C++ ./out/linuxx86/debug/plugins/stdphyslayer/entity.o ...


/// Header: ///
class celEntityList : public iCelEntityList
{
private:
  csRefArray<iCelEntity> entities;

public:
  celEntityList ();
  virtual ~celEntityList ();

  SCF_DECLARE_IBASE;

  virtual size_t GetCount () const;
  virtual iCelEntity* Get (size_t n) const;
  virtual size_t Add (iCelEntity* obj);
  virtual bool Remove (iCelEntity* obj);
  virtual bool Remove (size_t n);
  virtual void RemoveAll ();
  virtual size_t Find (iCelEntity* obj) const;
  virtual iCelEntity* FindByName (const char *Name) const;
  virtual csPtr<iCelEntityIterator> GetIterator () const;

  class Iterator :
    public scfImplementation1<Iterator, iCelEntityIterator>
  {
  private:
    csRefArray<iCelEntity>::Iterator it;

  public:
    Iterator (const celEntityList* parent);

    virtual iCelEntity* Next ();
    virtual bool HasNext () const;
  };

  friend class Iterator;
};

/// Implementation: ///
celEntityList::Iterator::Iterator (const celEntityList* parent) :
  scfImplementationType (this), it (parent->entities.GetIterator ())
{
}

iCelEntity* celEntityList::Iterator::Next ()
{
  return it.Next ();
}

bool celEntityList::Iterator::HasNext () const
{
  return it.HasNext ();
}