MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / create

Method create

Examples/SCExample/SCExample.cpp:111–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109 HotReloadOptionsStorage hotReloadOptionsStorage;
110
111 Result create()
112 {
113 currentThreadID = Thread::CurrentThreadID();
114 lastEventTime.snap();
115 SocketNetworking::initNetworking();
116 AsyncEventLoop::Options options;
117#if SC_PLATFORM_LINUX && 0
118 // Just for testing purposes, we can force using epoll instead of io_uring
119 options.apiType = AsyncEventLoop::Options::ApiType::ForceUseEpoll;
120#endif
121 SC_TRY(eventLoop.create(options));
122 timeout.callback = [this](AsyncLoopTimeout::Result& result) { onTimeout(result); };
123 SC_TRY(timeout.start(eventLoop, Time::Milliseconds(state.timeoutOccursEveryMs)));
124 eventLoopMonitor.onNewEventsAvailable = []() { sokol_wake_up(); };
125 SC_TRY(eventLoopMonitor.create(eventLoop));
126 SC_TRY(buildHotReloadOptions(hotReloadOptionsStorage));
127 const HotReloadSystem::Options hotReloadOptions = {hotReloadOptionsStorage.examplesPath.view(),
128 hotReloadOptionsStorage.defaultIncludePathsText.view()};
129 SC_TRY(hotReloadSystem.create(eventLoop, hotReloadOptions));
130 SC_TRY(hotReloadSystem.syncRegistry());
131 return Result(true);
132 }
133
134 void resetLastEventTime() { lastEventTime.snap(); }
135

Callers 15

startMethod · 0.45
saneMainFunction · 0.45
runAwaitProcessExitCodesFunction · 0.45
runAwaitServiceProbeFunction · 0.45
saneMainFunction · 0.45
runAwaitManifestPreviewFunction · 0.45
runAwaitConfigReloadFunction · 0.45
runAwaitBackgroundJobsFunction · 0.45
runAwaitDatagramPingFunction · 0.45
runAwaitFirstResponseFunction · 0.45
runAwaitFilePatchFunction · 0.45
runAwaitBackgroundDigestFunction · 0.45

Calls 7

MillisecondsClass · 0.85
sokol_wake_upFunction · 0.85
buildHotReloadOptionsFunction · 0.85
ResultClass · 0.50
startMethod · 0.45
viewMethod · 0.45
syncRegistryMethod · 0.45

Tested by

no test coverage detected