openexr-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Openexr-devel] Question about class Array


From: Paul Miller
Subject: Re: [Openexr-devel] Question about class Array
Date: Thu, 26 Oct 2017 09:27:12 -0500
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Array is inside a namespace defined by the EXR headers - it's usually "Imf".

See OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER

So you should use Imf::Array<>.

On 10/26/17 1:01 AM, qtech qtech wrote:

I am an inexperienced programmer trying to build and use openexr. I think my main problem is the linking. So I have this header file:

#ifndef INCLUDED_IMF_ARRAY_H
#define INCLUDED_IMF_ARRAY_H
#include "ImfForward.h"
OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
template <class T>
class Array
{
  public:
     Array ()               {_data = 0; _size = 0;}
     Array (long size)          {_data = new T[size]; _size = size;}
    ~Array ()               {delete [] _data;}
    operator T * ()         {return _data;}
    operator const T * () const     {return _data;}
    void resizeErase (long size);
    void resizeEraseUnsafe (long size);
    long size() const   {return _size;}
  private:
    Array (const Array &);  
    Array & operator = (const Array &);
    long _size;
    T * _data;
};

and my main file is

#include <iostream>
#include <OpenEXR/ImfArray.h>
using namespace std;
struct C
{
    C ()        {std::cout << "C::C  (" << this << ")\n";};
    virtual ~C ()   {std::cout << "C::~C (" << this << ")\n";};
};
int main ()
{
    Array <C> a(3);

    C &b = a[1];
    const C &c = a[1];
    C *d = a + 2;
    const C *e = a;
    return 0;
}

I keep getting the following error "‘Array’ was not declared in this scope"... I would really appreciate your help! Thank you in advance

Thank you,
Stelio


_______________________________________________
Openexr-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/openexr-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]