Where Online Learning is simpler!
The C and C++ Include Header Files
cat -n /usr/include/nodejs/src/timers.h
1 #ifndef SRC_TIMERS_H_ 2 #define SRC_TIMERS_H_ 3 4 #if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 5 6 #include <cinttypes> 7 #include "node_snapshotable.h" 8 9 namespace node { 10 class ExternalReferenceRegistry; 11 12 namespace timers { 13 class BindingData : public SnapshotableObject { 14 public: 15 BindingData(Realm* env, v8::Local<v8::Object> obj); 16 17 using InternalFieldInfo = InternalFieldInfoBase; 18 19 SET_BINDING_ID(timers_binding_data) 20 SERIALIZABLE_OBJECT_METHODS() 21 22 SET_NO_MEMORY_INFO() 23 SET_SELF_SIZE(BindingData) 24 SET_MEMORY_INFO_NAME(BindingData) 25 26 static void SetupTimers(const v8::FunctionCallbackInfo<v8::Value>& args); 27 28 static void SlowGetLibuvNow(const v8::FunctionCallbackInfo<v8::Value>& args); 29 static double FastGetLibuvNow(v8::Local<v8::Value> receiver); 30 static double GetLibuvNowImpl(BindingData* data); 31 32 static void SlowScheduleTimer( 33 const v8::FunctionCallbackInfo<v8::Value>& args); 34 static void FastScheduleTimer(v8::Local<v8::Object> receiver, 35 int64_t duration); 36 static void ScheduleTimerImpl(BindingData* data, int64_t duration); 37 38 static void SlowToggleTimerRef( 39 const v8::FunctionCallbackInfo<v8::Value>& args); 40 static void FastToggleTimerRef(v8::Local<v8::Object> receiver, bool ref); 41 static void ToggleTimerRefImpl(BindingData* data, bool ref); 42 43 static void SlowToggleImmediateRef( 44 const v8::FunctionCallbackInfo<v8::Value>& args); 45 static void FastToggleImmediateRef(v8::Local<v8::Object> receiver, bool ref); 46 static void ToggleImmediateRefImpl(BindingData* data, bool ref); 47 48 static void CreatePerIsolateProperties(IsolateData* isolate_data, 49 v8::Local<v8::ObjectTemplate> target); 50 static void CreatePerContextProperties(v8::Local<v8::Object> target, 51 v8::Local<v8::Value> unused, 52 v8::Local<v8::Context> context, 53 void* priv); 54 static void RegisterTimerExternalReferences( 55 ExternalReferenceRegistry* registry); 56 57 private: 58 static v8::CFunction fast_get_libuv_now_; 59 static v8::CFunction fast_schedule_timer_; 60 static v8::CFunction fast_toggle_timer_ref_; 61 static v8::CFunction fast_toggle_immediate_ref_; 62 }; 63 64 } // namespace timers 65 66 } // namespace node 67 68 #endif // defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS 69 70 #endif // SRC_TIMERS_H_