Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated exception specifications. #114

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions HostSupport/include/ofxhClip.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,31 +116,31 @@ namespace OFX {
bool isOutput() const {return _isOutput;}

/// notify override properties
virtual void notify(const std::string &name, bool isSingle, int indexOrN) OFX_EXCEPTION_SPEC;
virtual void notify(const std::string &name, bool isSingle, int indexOrN);

/// get hook override
virtual void reset(const std::string &name) OFX_EXCEPTION_SPEC;
virtual void reset(const std::string &name);

// get the virtuals for viewport size, pixel scale, background colour
virtual double getDoubleProperty(const std::string &name, int index) const OFX_EXCEPTION_SPEC;
virtual double getDoubleProperty(const std::string &name, int index) const;

// get the virtuals for viewport size, pixel scale, background colour
virtual void getDoublePropertyN(const std::string &name, double *values, int count) const OFX_EXCEPTION_SPEC;
virtual void getDoublePropertyN(const std::string &name, double *values, int count) const;

// get the virtuals for viewport size, pixel scale, background colour
virtual int getIntProperty(const std::string &name, int index) const OFX_EXCEPTION_SPEC;
virtual int getIntProperty(const std::string &name, int index) const;

// get the virtuals for viewport size, pixel scale, background colour
virtual void getIntPropertyN(const std::string &name, int *values, int count) const OFX_EXCEPTION_SPEC;
virtual void getIntPropertyN(const std::string &name, int *values, int count) const;

// get the virtuals for viewport size, pixel scale, background colour
virtual const std::string &getStringProperty(const std::string &name, int index) const OFX_EXCEPTION_SPEC;
virtual const std::string &getStringProperty(const std::string &name, int index) const;

// fetch multiple values in a multi-dimension property
virtual void getStringPropertyN(const std::string &name, const char** values, int count) const OFX_EXCEPTION_SPEC;
virtual void getStringPropertyN(const std::string &name, const char** values, int count) const;

// get hook virtuals
virtual int getDimension(const std::string &name) const OFX_EXCEPTION_SPEC;
virtual int getDimension(const std::string &name) const;

// instance changed action
OfxStatus instanceChangedAction(const std::string &why,
Expand Down
10 changes: 5 additions & 5 deletions HostSupport/include/ofxhImageEffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,19 +408,19 @@ namespace OFX {
int upperGetDimension(const std::string &name);

/// overridden from Property::Notify
virtual void notify(const std::string &name, bool singleValue, int indexOrN) OFX_EXCEPTION_SPEC;
virtual void notify(const std::string &name, bool singleValue, int indexOrN);

/// overridden from gethook, get the virutals for viewport size, pixel scale, background colour
virtual double getDoubleProperty(const std::string &name, int index) const OFX_EXCEPTION_SPEC;
virtual double getDoubleProperty(const std::string &name, int index) const;

/// overridden from gethook, get the virutals for viewport size, pixel scale, background colour
virtual void getDoublePropertyN(const std::string &name, double *values, int count) const OFX_EXCEPTION_SPEC;
virtual void getDoublePropertyN(const std::string &name, double *values, int count) const;

/// overridden from gethook, don't know what to do
virtual void reset(const std::string &name) OFX_EXCEPTION_SPEC;
virtual void reset(const std::string &name);

//// overridden from gethook
virtual int getDimension(const std::string &name) const OFX_EXCEPTION_SPEC;
virtual int getDimension(const std::string &name) const;

//
// live parameters
Expand Down
8 changes: 4 additions & 4 deletions HostSupport/include/ofxhInteract.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,16 +143,16 @@ namespace OFX {
virtual void getSlaveToParam(std::vector<std::string>& params) const;

// do nothing
virtual int getDimension(const std::string &name) const OFX_EXCEPTION_SPEC;
virtual int getDimension(const std::string &name) const;

// don't know what to do
virtual void reset(const std::string &name) OFX_EXCEPTION_SPEC;
virtual void reset(const std::string &name);

/// the gethook virutals for pixel scale, background colour
virtual double getDoubleProperty(const std::string &name, int index) const OFX_EXCEPTION_SPEC;
virtual double getDoubleProperty(const std::string &name, int index) const;

/// for pixel scale and background colour
virtual void getDoublePropertyN(const std::string &name, double *first, int n) const OFX_EXCEPTION_SPEC;
virtual void getDoublePropertyN(const std::string &name, double *first, int n) const;

/// call create instance
virtual OfxStatus createInstanceAction();
Expand Down
4 changes: 2 additions & 2 deletions HostSupport/include/ofxhParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ namespace OFX {
virtual OfxStatus integrateV(OfxTime time1, OfxTime time2, va_list arg);

/// overridden from Property::NotifyHook
virtual void notify(const std::string &name, bool single, int num) OFX_EXCEPTION_SPEC;
virtual void notify(const std::string &name, bool single, int num);
};

class KeyframeParam {
Expand Down Expand Up @@ -323,7 +323,7 @@ namespace OFX {
virtual OfxStatus setV(OfxTime time, va_list arg);

/// overridden from Instance
virtual void notify(const std::string &name, bool single, int num) OFX_EXCEPTION_SPEC;
virtual void notify(const std::string &name, bool single, int num);
};

class DoubleInstance : public Instance, public KeyframeParam {
Expand Down
48 changes: 21 additions & 27 deletions HostSupport/include/ofxhPropertySuite.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@
#include <algorithm>
#include <sstream>

#ifndef WINDOWS
#define OFX_EXCEPTION_SPEC throw (OFX::Host::Property::Exception)
#else
#define OFX_EXCEPTION_SPEC
#endif

namespace OFX {
namespace Host {
namespace Property {
Expand Down Expand Up @@ -126,41 +120,41 @@ namespace OFX {

/// We specialise this to do some magic so that it calls get string/int/double/pointer appropriately
/// this is what is called by the propertytemplate code to fetch values out of a hook.
template<class T> typename T::ReturnType getProperty(const std::string &name, int index=0) const OFX_EXCEPTION_SPEC;
template<class T> typename T::ReturnType getProperty(const std::string &name, int index=0) const;

/// We specialise this to do some magic so that it calls get int/double/pointer appropriately
/// this is what is called by the propertytemplate code to fetch values out of a hook.
template<class T> void getPropertyN(const std::string &name, typename T::APIType *values, int count) const OFX_EXCEPTION_SPEC;
template<class T> void getPropertyN(const std::string &name, typename T::APIType *values, int count) const;

/// override this to fetch a single value at the given index.
virtual const std::string& getStringProperty(const std::string &name, int index = 0) const OFX_EXCEPTION_SPEC;
virtual const std::string& getStringProperty(const std::string &name, int index = 0) const;

/// override this to fetch a multiple values in a multi-dimension property
virtual void getStringPropertyN(const std::string &name, const char** values, int count) const OFX_EXCEPTION_SPEC;
virtual void getStringPropertyN(const std::string &name, const char** values, int count) const;

/// override this to fetch a single value at the given index.
virtual int getIntProperty(const std::string &name, int index = 0) const OFX_EXCEPTION_SPEC;
virtual int getIntProperty(const std::string &name, int index = 0) const;

/// override this to fetch a multiple values in a multi-dimension property
virtual void getIntPropertyN(const std::string &name, int *values, int count) const OFX_EXCEPTION_SPEC;
virtual void getIntPropertyN(const std::string &name, int *values, int count) const;

/// override this to fetch a single value at the given index.
virtual double getDoubleProperty(const std::string &name, int index = 0) const OFX_EXCEPTION_SPEC;
virtual double getDoubleProperty(const std::string &name, int index = 0) const;

/// override this to fetch a multiple values in a multi-dimension property
virtual void getDoublePropertyN(const std::string &name, double *values, int count) const OFX_EXCEPTION_SPEC;
virtual void getDoublePropertyN(const std::string &name, double *values, int count) const;

/// override this to fetch a single value at the given index.
virtual void *getPointerProperty(const std::string &name, int index = 0) const OFX_EXCEPTION_SPEC;
virtual void *getPointerProperty(const std::string &name, int index = 0) const;

/// override this to fetch a multiple values in a multi-dimension property
virtual void getPointerPropertyN(const std::string &name, void **values, int count) const OFX_EXCEPTION_SPEC;
virtual void getPointerPropertyN(const std::string &name, void **values, int count) const;

/// override this to fetch the dimension size.
virtual int getDimension(const std::string &name) const OFX_EXCEPTION_SPEC;
virtual int getDimension(const std::string &name) const;

/// override this to handle a reset().
virtual void reset(const std::string &name) OFX_EXCEPTION_SPEC;
virtual void reset(const std::string &name);
};

/// Sits on a property and is called when the local property is being set.
Expand All @@ -178,7 +172,7 @@ namespace OFX {
/// \arg name is the name of the property just set
/// \arg singleValue is whether setProperty on a single index was call, otherwise N properties were set
/// \arg indexOrN is the index if single value is true, or the count if singleValue is false
virtual void notify(const std::string &name, bool singleValue, int indexOrN) OFX_EXCEPTION_SPEC = 0;
virtual void notify(const std::string &name, bool singleValue, int indexOrN) = 0;
};

/// base class for all properties
Expand Down Expand Up @@ -309,34 +303,34 @@ namespace OFX {
}

// get multiple values
void getValueN(APIType *value, int count) const OFX_EXCEPTION_SPEC;
void getValueN(APIType *value, int count) const;

#ifdef WINDOWS
#pragma warning( disable : 4181 )
#endif
/// get one value
const ReturnType getValue(int index=0) const OFX_EXCEPTION_SPEC;
const ReturnType getValue(int index=0) const;

/// get one value, without going through the getHook
const ReturnType getValueRaw(int index=0) const OFX_EXCEPTION_SPEC;
const ReturnType getValueRaw(int index=0) const;

#ifdef WINDOWS
#pragma warning( default : 4181 )
#endif
// get multiple values, without going through the getHook
void getValueNRaw(APIType *value, int count) const OFX_EXCEPTION_SPEC;
void getValueNRaw(APIType *value, int count) const;

/// set one value
void setValue(const Type &value, int index=0) OFX_EXCEPTION_SPEC;
void setValue(const Type &value, int index=0);

/// set multiple values
void setValueN(const APIType *value, int count) OFX_EXCEPTION_SPEC;
void setValueN(const APIType *value, int count);

/// reset
void reset() OFX_EXCEPTION_SPEC;
void reset();

/// get the size of the vector
int getDimension() const OFX_EXCEPTION_SPEC;
int getDimension() const;

/// return the value as a string
inline std::string getStringValue(int idx) {
Expand Down
18 changes: 9 additions & 9 deletions HostSupport/src/ofxhClip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,15 +214,15 @@ namespace OFX {
}

// do nothing
int ClipInstance::getDimension(const std::string &name) const OFX_EXCEPTION_SPEC
int ClipInstance::getDimension(const std::string &name) const
{
if(name == kOfxImageEffectPropUnmappedFrameRange || name == kOfxImageEffectPropFrameRange)
return 2;
return 1;
}

// don't know what to do
void ClipInstance::reset(const std::string &/*name*/) OFX_EXCEPTION_SPEC {
void ClipInstance::reset(const std::string &/*name*/) {
//printf("failing in %s\n", __PRETTY_FUNCTION__);
throw Property::Exception(kOfxStatErrMissingHostFeature);
}
Expand All @@ -240,7 +240,7 @@ namespace OFX {
}

// get the virutals for viewport size, pixel scale, background colour
void ClipInstance::getDoublePropertyN(const std::string &name, double *values, int n) const OFX_EXCEPTION_SPEC
void ClipInstance::getDoublePropertyN(const std::string &name, double *values, int n) const
{
if(name==kOfxImagePropPixelAspectRatio){
if(n>1) throw Property::Exception(kOfxStatErrValue);
Expand All @@ -267,7 +267,7 @@ namespace OFX {
}

// get the virutals for viewport size, pixel scale, background colour
double ClipInstance::getDoubleProperty(const std::string &name, int n) const OFX_EXCEPTION_SPEC
double ClipInstance::getDoubleProperty(const std::string &name, int n) const
{
if(name==kOfxImagePropPixelAspectRatio){
if(n!=0) throw Property::Exception(kOfxStatErrValue);
Expand Down Expand Up @@ -298,7 +298,7 @@ namespace OFX {
}

// get the virutals for viewport size, pixel scale, background colour
int ClipInstance::getIntProperty(const std::string &name, int n) const OFX_EXCEPTION_SPEC
int ClipInstance::getIntProperty(const std::string &name, int n) const
{
if(n!=0) throw Property::Exception(kOfxStatErrValue);
if(name==kOfxImageClipPropConnected){
Expand All @@ -312,14 +312,14 @@ namespace OFX {
}

// get the virutals for viewport size, pixel scale, background colour
void ClipInstance::getIntPropertyN(const std::string &name, int *values, int n) const OFX_EXCEPTION_SPEC
void ClipInstance::getIntPropertyN(const std::string &name, int *values, int n) const
{
if(n!=0) throw Property::Exception(kOfxStatErrValue);
*values = getIntProperty(name, 0);
}

// get the virutals for viewport size, pixel scale, background colour
const std::string &ClipInstance::getStringProperty(const std::string &name, int n) const OFX_EXCEPTION_SPEC
const std::string &ClipInstance::getStringProperty(const std::string &name, int n) const
{
if(n!=0) throw Property::Exception(kOfxStatErrValue);
if(name==kOfxImageEffectPropPixelDepth){
Expand All @@ -345,7 +345,7 @@ namespace OFX {
}

// fetch multiple values in a multi-dimension property
void ClipInstance::getStringPropertyN(const std::string &name, const char** values, int count) const OFX_EXCEPTION_SPEC
void ClipInstance::getStringPropertyN(const std::string &name, const char** values, int count) const
{
if (count == 0) {
return;
Expand Down Expand Up @@ -374,7 +374,7 @@ namespace OFX {
}

// notify override properties
void ClipInstance::notify(const std::string &/*name*/, bool /*isSingle*/, int /*indexOrN*/) OFX_EXCEPTION_SPEC
void ClipInstance::notify(const std::string &/*name*/, bool /*isSingle*/, int /*indexOrN*/)
{
}

Expand Down
12 changes: 6 additions & 6 deletions HostSupport/src/ofxhImageEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ namespace OFX {
}

// do nothing
int Instance::getDimension(const std::string &name) const OFX_EXCEPTION_SPEC {
int Instance::getDimension(const std::string &name) const {
printf("failing in %s with name=%s\n", __PRETTY_FUNCTION__, name.c_str());
throw Property::Exception(kOfxStatErrMissingHostFeature);
}
Expand All @@ -465,19 +465,19 @@ namespace OFX {
return _properties.getDimension(name);
}

void Instance::notify(const std::string &/*name*/, bool /*singleValue*/, int /*indexOrN*/) OFX_EXCEPTION_SPEC
void Instance::notify(const std::string &/*name*/, bool /*singleValue*/, int /*indexOrN*/)
{
printf("failing in %s\n", __PRETTY_FUNCTION__);
}

// don't know what to do
void Instance::reset(const std::string &/*name*/) OFX_EXCEPTION_SPEC {
void Instance::reset(const std::string &/*name*/) {
printf("failing in %s\n", __PRETTY_FUNCTION__);
throw Property::Exception(kOfxStatErrMissingHostFeature);
}

// get the virutals for viewport size, pixel scale, background colour
double Instance::getDoubleProperty(const std::string &name, int index) const OFX_EXCEPTION_SPEC
double Instance::getDoubleProperty(const std::string &name, int index) const
{
if(name==kOfxImageEffectPropProjectSize){
if(index>=2) throw Property::Exception(kOfxStatErrBadIndex);
Expand Down Expand Up @@ -513,7 +513,7 @@ namespace OFX {
throw Property::Exception(kOfxStatErrUnknown);
}

void Instance::getDoublePropertyN(const std::string &name, double* first, int n) const OFX_EXCEPTION_SPEC
void Instance::getDoublePropertyN(const std::string &name, double* first, int n) const
{
if(name==kOfxImageEffectPropProjectSize){
if(n>2) throw Property::Exception(kOfxStatErrBadIndex);
Expand Down Expand Up @@ -2175,7 +2175,7 @@ namespace OFX {
*memoryHandle = NULL;
return kOfxStatErrMemory;
}
} catch (std::bad_alloc) {
} catch (std::bad_alloc&) {
*memoryHandle = NULL;
return kOfxStatErrMemory;
} catch (...) {
Expand Down
8 changes: 4 additions & 4 deletions HostSupport/src/ofxhInteract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ namespace OFX {
}

// do nothing
int Instance::getDimension(const std::string &name) const OFX_EXCEPTION_SPEC
int Instance::getDimension(const std::string &name) const
{
if(name == kOfxInteractPropPixelScale){
return 2;
Expand All @@ -171,12 +171,12 @@ namespace OFX {
}

// do nothing function
void Instance::reset(const std::string &/*name*/) OFX_EXCEPTION_SPEC
void Instance::reset(const std::string &/*name*/)
{
// no-op
}

double Instance::getDoubleProperty(const std::string &name, int index) const OFX_EXCEPTION_SPEC
double Instance::getDoubleProperty(const std::string &name, int index) const
{
if(name == kOfxInteractPropPixelScale){
if(index>=2) throw Property::Exception(kOfxStatErrBadIndex);
Expand Down Expand Up @@ -210,7 +210,7 @@ namespace OFX {
throw Property::Exception(kOfxStatErrUnknown);
}

void Instance::getDoublePropertyN(const std::string &name, double *first, int n) const OFX_EXCEPTION_SPEC
void Instance::getDoublePropertyN(const std::string &name, double *first, int n) const
{
if(name == kOfxInteractPropPixelScale){
if(n>2) throw Property::Exception(kOfxStatErrBadIndex);
Expand Down
Loading