MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / Function

Class Function

include/cpp/Pointer.h:421–464  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

419
420template<typename T>
421class Function
422{
423public:
424 T *call;
425
426 inline Function( ) { }
427 inline Function( const Function &inRHS ) : call(inRHS.call) { }
428 inline Function( const Dynamic &inRHS) { call = inRHS==null()?0: (T*)inRHS->__GetHandle(); }
429 inline Function( const null &inRHS ) { call = 0; }
430 inline Function( T *inValue ) : call((T*)(inValue)) { }
431 //inline Function( T *inValue ) : call(inValue) { }
432 inline Function( AutoCast inValue ) : call( (T*)inValue.value) { }
433 inline Function( const hx::AnyCast &inValue ) : call( (T*)inValue.mPtr) { }
434
435 template<typename FROM>
436 inline static Function __new(FROM from)
437 {
438 return Function(from);
439 }
440
441 inline Function operator=( const Function &inRHS ) { return call = inRHS.call; }
442 inline Dynamic operator=( Dynamic &inValue )
443 {
444 call = inValue==null() ? 0 : (T*) inValue->__GetHandle();
445 return inValue;
446 }
447 inline Dynamic operator=( null &inValue ) { call=0; return inValue; }
448 inline bool operator==( const null &inValue ) const { return call==0; }
449 inline bool operator!=( const null &inValue ) const { return call!=0; }
450
451
452 operator Dynamic () const { return CreateDynamicPointer((void *)call); }
453 //operator hx::Val () const { return CreateDynamicPointer((void *)call); }
454 operator T * () { return call; }
455 operator void * () { return (void *)call; }
456
457 inline T &get_call() { return *call; }
458
459 inline bool lt(Function inOther) { return call < inOther.call; }
460 inline bool gt(Function inOther) { return call > inOther.call; }
461 inline bool leq(Function inOther) { return call <= inOther.call; }
462 inline bool geq(Function inOther) { return call >= inOther.call; }
463
464};
465
466
467template<typename T>

Callers 1

__newMethod · 0.70

Calls 1

CreateDynamicPointerFunction · 0.85

Tested by

no test coverage detected