src/nano/nano_signal_slot.hpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #ifndef MODEL_NANO_SIGNAL_SLOT_HPP | ||
| 2 | #define MODEL_NANO_SIGNAL_SLOT_HPP | ||
| 3 | |||
| 4 | #include "nano_function.hpp" | ||
| 5 | #include "nano_observer.hpp" | ||
| 6 | |||
| 7 | namespace Nano { | ||
| 8 | |||
| 9 | template <typename RT> | ||
| 10 | class Signal; | ||
| 11 | template <typename RT, typename... Args> | ||
| 12 | class Signal<RT(Args...)> : private Observer | ||
| 13 | { | ||
| 14 | template <typename T> | ||
| 15 | 723612 | void insert_sfinae(DelegateKey const& key, typename T::Observer* instance) { | |
| 16 | 723612 | Observer::insert(key, instance); | |
| 17 | 723612 | instance->insert(key, this); | |
| 18 | 723612 | } | |
| 19 | template <typename T> | ||
| 20 | 9965 | void remove_sfinae(DelegateKey const& key, typename T::Observer* instance) { | |
| 21 | 9965 | Observer::remove(key, instance); | |
| 22 | 9965 | instance->remove(key, this); | |
| 23 | 9965 | } | |
| 24 | template <typename T> | ||
| 25 | 311 | void insert_sfinae(DelegateKey const& key, ...) { | |
| 26 | 311 | Observer::insert(key, this); | |
| 27 | 311 | } | |
| 28 | template <typename T> | ||
| 29 | 3 | void remove_sfinae(DelegateKey const& key, ...) { | |
| 30 | 3 | Observer::remove(key, this); | |
| 31 | 3 | } | |
| 32 | |||
| 33 | public: | ||
| 34 | using Delegate = Function<RT(Args...)>; | ||
| 35 | |||
| 36 | //-------------------------------------------------------------------CONNECT | ||
| 37 | |||
| 38 | template <typename L> | ||
| 39 | void connect(L* instance) { | ||
| 40 | Observer::insert(Delegate::bind(instance), this); | ||
| 41 | } | ||
| 42 | template <typename L> | ||
| 43 | void connect(L& instance) { | ||
| 44 | connect(std::addressof(instance)); | ||
| 45 | } | ||
| 46 | |||
| 47 | template <RT (*fun_ptr)(Args...)> | ||
| 48 | void connect() { | ||
| 49 | Observer::insert(Delegate::template bind<fun_ptr>(), this); | ||
| 50 | } | ||
| 51 | |||
| 52 | template <typename T, RT (T::*mem_ptr)(Args...)> | ||
| 53 | 723923 | void connect(T* instance) { | |
| 54 |
155/282void Nano::Signal<void ()>::connect<IdfFixture_IdfObject_initializeFields_Test::TestBody()::NanoIntercepter, &(IdfFixture_IdfObject_initializeFields_Test::TestBody()::IdfFixture_IdfObject_initializeFields_Test::TestBody()::NanoIntercepter::onChange())>(IdfFixture_IdfObject_initializeFields_Test::TestBody()::NanoIntercepter*):
✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
void Nano::Signal<void ()>::connect<IdfFixture_IdfObject_initializeFields_Test::TestBody()::NanoIntercepter, &(IdfFixture_IdfObject_initializeFields_Test::TestBody()::IdfFixture_IdfObject_initializeFields_Test::TestBody()::NanoIntercepter::onDataChange())>(IdfFixture_IdfObject_initializeFields_Test::TestBody()::NanoIntercepter*):
✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
void Nano::Signal<void ()>::connect<IdfFixture_IdfObject_initializeFields_Test::TestBody()::NanoIntercepter, &(IdfFixture_IdfObject_initializeFields_Test::TestBody()::IdfFixture_IdfObject_initializeFields_Test::TestBody()::NanoIntercepter::onNameChange())>(IdfFixture_IdfObject_initializeFields_Test::TestBody()::NanoIntercepter*):
✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
void Nano::Signal<void ()>::connect<WorkflowJSONListener, &WorkflowJSONListener::makeDirty>(WorkflowJSONListener*):
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
void Nano::Signal<void ()>::connect<openstudio::IdfObjectWatcher, &openstudio::IdfObjectWatcher::change>(openstudio::IdfObjectWatcher*):
✓ Branch 0 taken 16 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 16 times.
✓ Branch 7 taken 16 times.
void Nano::Signal<void ()>::connect<openstudio::IdfObjectWatcher, &openstudio::IdfObjectWatcher::dataChange>(openstudio::IdfObjectWatcher*):
✓ Branch 0 taken 16 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 16 times.
✓ Branch 7 taken 16 times.
void Nano::Signal<void ()>::connect<openstudio::IdfObjectWatcher, &openstudio::IdfObjectWatcher::nameChange>(openstudio::IdfObjectWatcher*):
✓ Branch 0 taken 16 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 16 times.
✓ Branch 7 taken 16 times.
void Nano::Signal<void ()>::connect<openstudio::WorkspaceWatcher, &openstudio::WorkspaceWatcher::change>(openstudio::WorkspaceWatcher*):
✓ Branch 1 taken 7 times.
✓ Branch 5 taken 7 times.
void Nano::Signal<void ()>::connect<openstudio::detail::WorkflowJSON_Impl, &openstudio::detail::WorkflowJSON_Impl::onUpdate>(openstudio::detail::WorkflowJSON_Impl*):
✓ Branch 1 taken 278 times.
✓ Branch 5 taken 278 times.
void Nano::Signal<void ()>::connect<openstudio::detail::Workspace_Impl, &openstudio::detail::Workspace_Impl::change>(openstudio::detail::Workspace_Impl*):
✓ Branch 0 taken 572785 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 572785 times.
✓ Branch 7 taken 572785 times.
void Nano::Signal<void ()>::connect<openstudio::model::detail::ComponentWatcher_Impl, &openstudio::model::detail::ComponentWatcher_Impl::componentDataChange>(openstudio::model::detail::ComponentWatcher_Impl*):
✓ Branch 0 taken 875 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 875 times.
✓ Branch 7 taken 875 times.
void Nano::Signal<void ()>::connect<openstudio::model::detail::ComponentWatcher_Impl, &openstudio::model::detail::ComponentWatcher_Impl::dataChange>(openstudio::model::detail::ComponentWatcher_Impl*):
✓ Branch 0 taken 1167 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1167 times.
✓ Branch 7 taken 1167 times.
void Nano::Signal<void ()>::connect<openstudio::model::detail::ComponentWatcher_Impl, &openstudio::model::detail::ComponentWatcher_Impl::nameChange>(openstudio::model::detail::ComponentWatcher_Impl*):
✓ Branch 0 taken 1167 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1167 times.
✓ Branch 7 taken 1167 times.
void Nano::Signal<void ()>::connect<openstudio::model::detail::PlanarSurfaceGroup_Impl, &openstudio::model::detail::PlanarSurfaceGroup_Impl::clearCachedVariables>(openstudio::model::detail::PlanarSurfaceGroup_Impl*):
✓ Branch 0 taken 13510 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 13510 times.
✓ Branch 7 taken 13510 times.
void Nano::Signal<void ()>::connect<openstudio::model::detail::PlanarSurface_Impl, &openstudio::model::detail::PlanarSurface_Impl::clearCachedVariables>(openstudio::model::detail::PlanarSurface_Impl*):
✓ Branch 0 taken 100054 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 100054 times.
✓ Branch 7 taken 100054 times.
void Nano::Signal<void ()>::connect<openstudio::model::detail::ScheduleDay_Impl, &openstudio::model::detail::ScheduleDay_Impl::clearCachedVariables>(openstudio::model::detail::ScheduleDay_Impl*):
✓ Branch 0 taken 27839 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 27839 times.
✓ Branch 7 taken 27839 times.
void Nano::Signal<void (int)>::connect<openstudio::ProgressBar, &openstudio::ProgressBar::setValue>(openstudio::ProgressBar*):
✗ Branch 1 not taken.
✗ Branch 5 not taken.
void Nano::Signal<void (int, int)>::connect<openstudio::ProgressBar, &openstudio::ProgressBar::setRange>(openstudio::ProgressBar*):
✗ Branch 1 not taken.
✗ Branch 5 not taken.
void Nano::Signal<void (int, openstudio::UUID, openstudio::UUID)>::connect<openstudio::WorkspaceObjectWatcher, &openstudio::WorkspaceObjectWatcher::relationshipChange>(openstudio::WorkspaceObjectWatcher*):
✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 14 times.
✓ Branch 7 taken 14 times.
void Nano::Signal<void (int, openstudio::UUID, openstudio::UUID)>::connect<openstudio::model::detail::ComponentWatcher_Impl, &openstudio::model::detail::ComponentWatcher_Impl::relationshipChange>(openstudio::model::detail::ComponentWatcher_Impl*):
✓ Branch 0 taken 1167 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 1167 times.
✓ Branch 7 taken 1167 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::WorkspaceObjectWatcher, &openstudio::WorkspaceObjectWatcher::removedFromWorkspace>(openstudio::WorkspaceObjectWatcher*):
✓ Branch 0 taken 14 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 14 times.
✓ Branch 7 taken 14 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::ComponentWatcher_Impl, &openstudio::model::detail::ComponentWatcher_Impl::objectRemove>(openstudio::model::detail::ComponentWatcher_Impl*):
✓ Branch 0 taken 2036 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 2036 times.
✓ Branch 7 taken 2036 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedAirflowNetworkSimulationControl>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedBuilding>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 771 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 771 times.
✓ Branch 7 taken 771 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedClimateZones>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedConvergenceLimits>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedEnvironmentalImpactFactors>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 7 taken 1 time.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedExternalInterface>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedFacility>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 13 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 13 times.
✓ Branch 7 taken 13 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedFoundationKivaSettings>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 7 taken 1 time.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedHeatBalanceAlgorithm>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedInsideSurfaceConvectionAlgorithm>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedLifeCycleCostParameters>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 20 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 20 times.
✓ Branch 7 taken 20 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedLightingSimulationControl>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputConstructions>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 7 taken 2 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputControlFiles>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 33 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 33 times.
✓ Branch 7 taken 33 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputControlReportingTolerances>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 7 taken 1 time.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputControlResilienceSummaries>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 7 taken 2 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputControlTableStyle>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 7 taken 1 time.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputControlTimestamp>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 7 taken 2 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputDebuggingData>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 7 taken 2 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputDiagnostics>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 7 taken 1 time.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputEnergyManagementSystem>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputJSON>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 4 times.
✓ Branch 7 taken 4 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputSQLite>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 7 taken 1 time.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputSchedules>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 7 taken 2 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutputTableSummaryReports>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 7 taken 1 time.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedOutsideSurfaceConvectionAlgorithm>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedPerformancePrecisionTradeoffs>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 7 taken 1 time.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedPythonPluginSearchPaths>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedRadianceParameters>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✓ Branch 7 taken 3 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedRunPeriod>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 55 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 55 times.
✓ Branch 7 taken 55 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedRunPeriodControlDaylightSavingTime>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 3 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 3 times.
✓ Branch 7 taken 3 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedShadowCalculation>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 6 times.
✓ Branch 7 taken 6 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedSimulationControl>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 55 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 55 times.
✓ Branch 7 taken 55 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedSite>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 11 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 11 times.
✓ Branch 7 taken 11 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedSiteGroundReflectance>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedSiteGroundTemperatureBuildingSurface>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedSiteGroundTemperatureDeep>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedSiteGroundTemperatureFCfactorMethod>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedSiteGroundTemperatureShallow>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedSiteWaterMainsTemperature>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 4 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 4 times.
✓ Branch 7 taken 4 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedSizingParameters>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedTimestep>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 50 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 50 times.
✓ Branch 7 taken 50 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedWeatherFile>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 26 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 26 times.
✓ Branch 7 taken 26 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedYearDescription>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 125 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 125 times.
✓ Branch 7 taken 125 times.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedZoneAirContaminantBalance>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedZoneAirHeatBalanceAlgorithm>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 1 time.
✗ Branch 1 not taken.
✓ Branch 3 taken 1 time.
✓ Branch 7 taken 1 time.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedZoneAirMassFlowConservation>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::UUID const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::clearCachedZoneCapacitanceMultiplierResearchSpecial>(openstudio::model::detail::Model_Impl*):
✗ Branch 0 not taken.
✗ Branch 1 not taken.
✗ Branch 3 not taken.
✗ Branch 7 not taken.
void Nano::Signal<void (openstudio::WorkspaceObject const&, openstudio::IddObjectType const&, openstudio::UUID const&)>::connect<WorkspaceReciever, &WorkspaceReciever::addWorkspaceObject>(WorkspaceReciever*):
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
void Nano::Signal<void (openstudio::WorkspaceObject const&, openstudio::IddObjectType const&, openstudio::UUID const&)>::connect<WorkspaceReciever, &WorkspaceReciever::removeWorkspaceObject>(WorkspaceReciever*):
✓ Branch 1 taken 1 time.
✓ Branch 5 taken 1 time.
void Nano::Signal<void (openstudio::WorkspaceObject const&, openstudio::IddObjectType const&, openstudio::UUID const&)>::connect<openstudio::WorkspaceWatcher, &openstudio::WorkspaceWatcher::objectAdd>(openstudio::WorkspaceWatcher*):
✓ Branch 1 taken 7 times.
✓ Branch 5 taken 7 times.
void Nano::Signal<void (openstudio::WorkspaceObject const&, openstudio::IddObjectType const&, openstudio::UUID const&)>::connect<openstudio::WorkspaceWatcher, &openstudio::WorkspaceWatcher::objectRemove>(openstudio::WorkspaceWatcher*):
✓ Branch 1 taken 7 times.
✓ Branch 5 taken 7 times.
void Nano::Signal<void (openstudio::WorkspaceObject const&, openstudio::IddObjectType const&, openstudio::UUID const&)>::connect<openstudio::model::detail::ComponentWatcher_Impl, &openstudio::model::detail::ComponentWatcher_Impl::objectAdd>(openstudio::model::detail::ComponentWatcher_Impl*):
✓ Branch 0 taken 869 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 869 times.
✓ Branch 7 taken 869 times.
void Nano::Signal<void (openstudio::model::ComponentWatcher const&)>::connect<openstudio::model::detail::Model_Impl, &openstudio::model::detail::Model_Impl::obsoleteComponentWatcher>(openstudio::model::detail::Model_Impl*):
✓ Branch 0 taken 869 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 869 times.
✓ Branch 7 taken 869 times.
void Nano::Signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>::connect<openstudio::ProgressBar, &openstudio::ProgressBar::setWindowTitle>(openstudio::ProgressBar*):
✗ Branch 1 not taken.
✗ Branch 5 not taken.
|
723923 | insert_sfinae<T>(Delegate::template bind<T, mem_ptr>(instance), instance); |
| 55 | 723923 | } | |
| 56 | template <typename T, RT (T::*mem_ptr)(Args...) const> | ||
| 57 | void connect(T* instance) { | ||
| 58 | insert_sfinae<T>(Delegate::template bind<T, mem_ptr>(instance), instance); | ||
| 59 | } | ||
| 60 | |||
| 61 | template <typename T, RT (T::*mem_ptr)(Args...)> | ||
| 62 | 1 | void connect(T& instance) { | |
| 63 | 1 | connect<T, mem_ptr>(std::addressof(instance)); | |
| 64 | 1 | } | |
| 65 | template <typename T, RT (T::*mem_ptr)(Args...) const> | ||
| 66 | void connect(T& instance) { | ||
| 67 | connect<T, mem_ptr>(std::addressof(instance)); | ||
| 68 | } | ||
| 69 | |||
| 70 | //----------------------------------------------------------------DISCONNECT | ||
| 71 | |||
| 72 | template <typename L> | ||
| 73 | void disconnect(L* instance) { | ||
| 74 | Observer::remove(Delegate::bind(instance), this); | ||
| 75 | } | ||
| 76 | template <typename L> | ||
| 77 | void disconnect(L& instance) { | ||
| 78 | disconnect(std::addressof(instance)); | ||
| 79 | } | ||
| 80 | |||
| 81 | template <RT (*fun_ptr)(Args...)> | ||
| 82 | void disconnect() { | ||
| 83 | Observer::remove(Delegate::template bind<fun_ptr>(), this); | ||
| 84 | } | ||
| 85 | |||
| 86 | template <typename T, RT (T::*mem_ptr)(Args...)> | ||
| 87 | 9968 | void disconnect(T* instance) { | |
| 88 |
8/16void Nano::Signal<void ()>::disconnect<openstudio::detail::WorkflowJSON_Impl, &openstudio::detail::WorkflowJSON_Impl::onUpdate>(openstudio::detail::WorkflowJSON_Impl*):
✓ Branch 1 taken 3 times.
✓ Branch 5 taken 3 times.
void Nano::Signal<void ()>::disconnect<openstudio::detail::Workspace_Impl, &openstudio::detail::Workspace_Impl::change>(openstudio::detail::Workspace_Impl*):
✓ Branch 0 taken 9959 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 9959 times.
✓ Branch 7 taken 9959 times.
void Nano::Signal<void ()>::disconnect<openstudio::model::detail::ComponentWatcher_Impl, &openstudio::model::detail::ComponentWatcher_Impl::componentDataChange>(openstudio::model::detail::ComponentWatcher_Impl*):
✓ Branch 0 taken 6 times.
✗ Branch 1 not taken.
✓ Branch 3 taken 6 times.
✓ Branch 7 taken 6 times.
void Nano::Signal<void (int)>::disconnect<openstudio::ProgressBar, &openstudio::ProgressBar::setValue>(openstudio::ProgressBar*):
✗ Branch 1 not taken.
✗ Branch 5 not taken.
void Nano::Signal<void (int, int)>::disconnect<openstudio::ProgressBar, &openstudio::ProgressBar::setRange>(openstudio::ProgressBar*):
✗ Branch 1 not taken.
✗ Branch 5 not taken.
void Nano::Signal<void (std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)>::disconnect<openstudio::ProgressBar, &openstudio::ProgressBar::setWindowTitle>(openstudio::ProgressBar*):
✗ Branch 1 not taken.
✗ Branch 5 not taken.
|
9968 | remove_sfinae<T>(Delegate::template bind<T, mem_ptr>(instance), instance); |
| 89 | 9968 | } | |
| 90 | template <typename T, RT (T::*mem_ptr)(Args...) const> | ||
| 91 | void disconnect(T* instance) { | ||
| 92 | remove_sfinae<T>(Delegate::template bind<T, mem_ptr>(instance), instance); | ||
| 93 | } | ||
| 94 | |||
| 95 | template <typename T, RT (T::*mem_ptr)(Args...)> | ||
| 96 | void disconnect(T& instance) { | ||
| 97 | disconnect<T, mem_ptr>(std::addressof(instance)); | ||
| 98 | } | ||
| 99 | template <typename T, RT (T::*mem_ptr)(Args...) const> | ||
| 100 | void disconnect(T& instance) { | ||
| 101 | disconnect<T, mem_ptr>(std::addressof(instance)); | ||
| 102 | } | ||
| 103 | |||
| 104 | //----------------------------------------------------EMIT / EMIT ACCUMULATE | ||
| 105 | |||
| 106 | #ifdef NANO_USE_DEPRECATED | ||
| 107 | |||
| 108 | /// Will not benefit from perfect forwarding | ||
| 109 | /// TODO [[deprecated]] when c++14 is comfortably supported | ||
| 110 | |||
| 111 | void operator()(Args... args) { | ||
| 112 | emit(std::forward<Args>(args)...); | ||
| 113 | } | ||
| 114 | template <typename Accumulate> | ||
| 115 | void operator()(Args... args, Accumulate&& accumulate) { | ||
| 116 | emit_accumulate<Accumulate>(std::forward<Accumulate>(accumulate), std::forward<Args>(args)...); | ||
| 117 | } | ||
| 118 | |||
| 119 | #endif | ||
| 120 | |||
| 121 | template <typename... Uref> | ||
| 122 | 10745161 | void nano_emit(Uref&&... args) { | |
| 123 | 10745161 | Observer::onEach<Delegate>(std::forward<Uref>(args)...); | |
| 124 | 10745161 | } | |
| 125 | |||
| 126 | template <typename Accumulate, typename... Uref> | ||
| 127 | void emit_accumulate(Accumulate&& accumulate, Uref&&... args) { | ||
| 128 | Observer::onEach_Accumulate<Delegate, Accumulate>(std::forward<Accumulate>(accumulate), std::forward<Uref>(args)...); | ||
| 129 | } | ||
| 130 | |||
| 131 | //-------------------------------------------------------------------UTILITY | ||
| 132 | |||
| 133 | bool empty() const { | ||
| 134 | return Observer::ss_isEmpty(); | ||
| 135 | } | ||
| 136 | |||
| 137 | void removeAll() { | ||
| 138 | Observer::removeAll(); | ||
| 139 | } | ||
| 140 | }; | ||
| 141 | |||
| 142 | } // namespace Nano | ||
| 143 | |||
| 144 | #endif // MODEL_NANO_SIGNAL_SLOT_HPP | ||
| 145 |