ngryman / ribs

:meat_on_bone: Responsive Images Baked Server-side.
GNU General Public License v3.0
39 stars 8 forks source link

tweaks to operation api. #21

Closed ngryman closed 10 years ago

ngryman commented 10 years ago
#define RIBS_OPERATION(name)                 \
    Operation<name ## Operation>::Enqueue(args);
template<class T>
static Operation<T>::Enqueue(_NAN_METHOD_ARGS) {
    NanScope();
    Operation* op;
    try {
        op = new T(args);
    }
    catch (const std::string e) {
        return ThrowException(Exception::Error(String::New(e.c_str())));
    }
    op->Enqueue();
    NanReturnUndefined();
}
ngryman commented 10 years ago

I didn't use of templates for now because there is no really need to.

To ease operations development I've added some helper macros: https://github.com/ngryman/ribs/commit/7f8eb88fff2cfe28d531c342fc6040185cf2d801. I'm not sure of those yet, It defintly simplify and abstract the way operations work, but I don't find this elegant... Let's keep that for now until I find something better or decide to remove them :)