Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transition from sigcpp-2 to sigcpp-3 #36343

Merged
merged 2 commits into from
Dec 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/CSGAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ class CSGAction : public sigc::trackable {
Bool_t resizeMenuEntry();
void activate() { activated.emit(); }

sigc::signal<void> activated;
sigc::signal<void()> activated;

CSGAction(const CSGAction&) = delete; // stop default

Expand Down
4 changes: 2 additions & 2 deletions Fireworks/Core/interface/CSGContinuousAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ class CSGContinuousAction : public CSGAction {
UInt_t option = 0);
void stop();

sigc::signal<void> started_;
sigc::signal<void> stopped_;
sigc::signal<void()> started_;
sigc::signal<void()> stopped_;

//override
void globalEnable() override;
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/CmsShowCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class CmsShowCommon : public FWConfigurableParameterizable {
void setEventCenter(float, float, float);
void resetEventCenter();

mutable sigc::signal<void, const CmsShowCommon*> eventCenterChanged_;
mutable sigc::signal<void(const CmsShowCommon*)> eventCenterChanged_;

protected:
const FWColorManager* colorManager() const;
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/CmsShowMainBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class CmsShowMainBase {
timeout_();
return true;
}
sigc::signal<void> timeout_;
sigc::signal<void()> timeout_;
};

protected:
Expand Down
10 changes: 5 additions & 5 deletions Fireworks/Core/interface/CmsShowNavigator.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ class CmsShowNavigator : public FWNavigatorBase {

std::vector<std::string>& getProcessList() const;

sigc::signal<void, const TFile*> fileChanged_;
sigc::signal<void> preFiltering_;
sigc::signal<void, bool> postFiltering_;
sigc::signal<void, bool> editFiltersExternally_;
sigc::signal<void, int> filterStateChanged_;
sigc::signal<void(const TFile*)> fileChanged_;
sigc::signal<void()> preFiltering_;
sigc::signal<void(bool)> postFiltering_;
sigc::signal<void(bool)> editFiltersExternally_;
sigc::signal<void(int)> filterStateChanged_;

private:
CmsShowNavigator(const CmsShowNavigator&); // stop default
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/CmsShowTaskExecutorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CmsShowTaskExecutorBase {

virtual void startDoingTasks() = 0;

sigc::signal<void> tasksCompleted_;
sigc::signal<void()> tasksCompleted_;

protected:
virtual void doNextTaskImp() = 0;
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/CmsShowViewPopup.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class CmsShowViewPopup : public TGTransientFrame {
void backgroundColorWasChanged();
TEveWindow* getEveWindow() const { return m_eveWindow; }
#ifndef __CINT__
sigc::signal<void> closed_;
sigc::signal<void()> closed_;
#endif

ClassDefOverride(CmsShowViewPopup, 0);
Expand Down
8 changes: 4 additions & 4 deletions Fireworks/Core/interface/FWColorManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ class FWColorManager {

void setDefaultGeomColors();
void propagatePaletteChanges() const;
mutable sigc::signal<void> colorsHaveChanged_;
mutable sigc::signal<void> geomColorsHaveChanged_;
mutable sigc::signal<void, bool> geomTransparencyHaveChanged_;
mutable sigc::signal<void()> colorsHaveChanged_;
mutable sigc::signal<void()> geomColorsHaveChanged_;
mutable sigc::signal<void(bool)> geomTransparencyHaveChanged_;

//called after all the slots attached to colorsHaveChanged_ are done
mutable sigc::signal<void> colorsHaveChangedFinished_;
mutable sigc::signal<void()> colorsHaveChangedFinished_;

FWColorManager(const FWColorManager&) = delete; // stop default

Expand Down
6 changes: 3 additions & 3 deletions Fireworks/Core/interface/FWEventItemsManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class FWEventItemsManager : public FWConfigurable {

void setContext(fireworks::Context*);

sigc::signal<void, FWEventItem*> newItem_;
sigc::signal<void, const FWEventItem*> removingItem_;
sigc::signal<void> goingToClearItems_;
sigc::signal<void(FWEventItem*)> newItem_;
sigc::signal<void(const FWEventItem*)> removingItem_;
sigc::signal<void()> goingToClearItems_;

FWEventItemsManager(const FWEventItemsManager&) = delete; // stop default

Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/FWGLEventHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FWGLEventHandler : public TEveLegoEventHandler {
Bool_t HandleFocusChange(Event_t *event) override;
Bool_t HandleCrossing(Event_t *event) override;

sigc::signal<void, Int_t, Int_t> openSelectedModelContextMenu_;
sigc::signal<void(Int_t, Int_t)> openSelectedModelContextMenu_;

void setViewer(FWEveView *ev) { m_viewer = ev; }

Expand Down
26 changes: 13 additions & 13 deletions Fireworks/Core/interface/FWGUIManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,19 +200,19 @@ class FWGUIManager : public FWConfigurable {
void resetWMOffsets();

// signals
sigc::signal<void> filterButtonClicked_;
sigc::signal<void, const TGWindow*> showEventFilterGUI_;
sigc::signal<void, const std::string&> writeToConfigurationFile_;
sigc::signal<void, const std::string&> writePartialToConfigurationFile_;
sigc::signal<void, const std::string&> loadFromConfigurationFile_;
sigc::signal<void, const std::string&> loadPartialFromConfigurationFile_;
sigc::signal<void, edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t> changedEventId_;
sigc::signal<void> goingToQuit_;
sigc::signal<void> writeToPresentConfigurationFile_;

sigc::signal<void> changedRunEntry_;
sigc::signal<void> changedEventEntry_;
sigc::signal<void, Float_t> changedDelayBetweenEvents_;
sigc::signal<void()> filterButtonClicked_;
sigc::signal<void(const TGWindow*)> showEventFilterGUI_;
sigc::signal<void(const std::string&)> writeToConfigurationFile_;
sigc::signal<void(const std::string&)> writePartialToConfigurationFile_;
sigc::signal<void(const std::string&)> loadFromConfigurationFile_;
sigc::signal<void(const std::string&)> loadPartialFromConfigurationFile_;
sigc::signal<void(edm::RunNumber_t, edm::LuminosityBlockNumber_t, edm::EventNumber_t)> changedEventId_;
sigc::signal<void()> goingToQuit_;
sigc::signal<void()> writeToPresentConfigurationFile_;

sigc::signal<void()> changedRunEntry_;
sigc::signal<void()> changedEventEntry_;
sigc::signal<void(Float_t)> changedDelayBetweenEvents_;

FWGUIManager(const FWGUIManager&) = delete; // stop default
const FWGUIManager& operator=(const FWGUIManager&) = delete; // stop default
Expand Down
8 changes: 4 additions & 4 deletions Fireworks/Core/interface/FWGUISubviewArea.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ class FWGUISubviewArea : public TGHorizontalFrame {
void selectButtonToggle();

#ifndef __CINT__
sigc::signal<void, FWGUISubviewArea*> swap_;
sigc::signal<void, FWGUISubviewArea*> goingToBeDestroyed_;
sigc::signal<void, FWGUISubviewArea*> selected_;
sigc::signal<void, FWGUISubviewArea*> unselected_;
sigc::signal<void(FWGUISubviewArea*)> swap_;
sigc::signal<void(FWGUISubviewArea*)> goingToBeDestroyed_;
sigc::signal<void(FWGUISubviewArea*)> selected_;
sigc::signal<void(FWGUISubviewArea*)> unselected_;
#endif
void setInfoButton(bool downp);

Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/FWGenericParameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class FWGenericParameter : public FWParameterBase {
changed_(iValue);
}

sigc::signal<void, T> changed_;
sigc::signal<void(T)> changed_;

FWGenericParameter(const FWGenericParameter&) = delete; // stop default
const FWGenericParameter& operator=(const FWGenericParameter&) = delete; // stop default
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/FWIntValueListener.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FWIntValueListener : public FWIntValueListenerBase {

// ---------- member, functions -------------------------
void setValueImp(Int_t entry) override;
sigc::signal<void, Int_t> valueChanged_;
sigc::signal<void(Int_t)> valueChanged_;

FWIntValueListener(const FWIntValueListener&) = delete; // stop default
const FWIntValueListener& operator=(const FWIntValueListener&) = delete; // stop default
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/FWItemChangeSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@

// forward declarations
class FWEventItem;
typedef sigc::signal<void, const FWEventItem*> FWItemChangeSignal;
typedef sigc::signal<void(const FWEventItem*)> FWItemChangeSignal;
#endif
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/FWJobMetadataManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class FWJobMetadataManager {
// needed by FWDetailViewManager
virtual bool hasModuleLabel(std::string &moduleLabel) = 0;

sigc::signal<void> metadataChanged_;
sigc::signal<void()> metadataChanged_;

protected:
/** This is the bit that needs to be implemented by a derived class
Expand Down
4 changes: 2 additions & 2 deletions Fireworks/Core/interface/FWModelChangeManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class FWModelChangeManager {
void changed(const FWEventItem*);
void endChanges();

sigc::signal<void> changeSignalsAreComing_;
sigc::signal<void> changeSignalsAreDone_;
sigc::signal<void()> changeSignalsAreComing_;
sigc::signal<void()> changeSignalsAreDone_;

void newItemSlot(FWEventItem*);
void itemsGoingToBeClearedSlot(void);
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/FWModelChangeSignal.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// forward declarations
class FWModelId;
typedef std::set<FWModelId> FWModelIds;
typedef sigc::signal<void, const FWModelIds&> FWModelChangeSignal;
typedef sigc::signal<void(const FWModelIds&)> FWModelChangeSignal;
#endif
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/FWNavigatorBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class FWNavigatorBase : public FWConfigurable {
virtual int getNSelectedEvents() = 0;
virtual int getNTotalEvents() = 0;

sigc::signal<void> newEvent_;
sigc::signal<void()> newEvent_;

FWNavigatorBase(const FWNavigatorBase&) = delete; // stop default
const FWNavigatorBase& operator=(const FWNavigatorBase&) = delete; // stop default
Expand Down
4 changes: 2 additions & 2 deletions Fireworks/Core/interface/FWSelectionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ class FWSelectionManager {
void clearItemSelection();
void clearModelSelectionLeaveItem();

sigc::signal<void, const FWSelectionManager&> selectionChanged_;
sigc::signal<void, const FWSelectionManager&> itemSelectionChanged_;
sigc::signal<void(const FWSelectionManager&)> selectionChanged_;
sigc::signal<void(const FWSelectionManager&)> itemSelectionChanged_;

FWSelectionManager(const FWSelectionManager&) = delete; // stop default

Expand Down
4 changes: 2 additions & 2 deletions Fireworks/Core/interface/FWViewBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ class FWViewBase : public FWConfigurableParameterizable {
// ---------- member functions ---------------------------
void destroy();

sigc::signal<void, const FWViewBase*> beingDestroyed_;
sigc::signal<void, Int_t, Int_t> openSelectedModelContextMenu_;
sigc::signal<void(const FWViewBase*)> beingDestroyed_;
sigc::signal<void(Int_t, Int_t)> openSelectedModelContextMenu_;

protected:
~FWViewBase() override;
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/FWViewContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FWViewContext {

void scaleChanged();

mutable sigc::signal<void, const FWViewContext*> scaleChanged_;
mutable sigc::signal<void(const FWViewContext*)> scaleChanged_;

FWViewContext(const FWViewContext&) = delete; // stop default

Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/interface/FWViewEnergyScale.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class FWViewEnergyScale : public FWConfigurableParameterizable {

void scaleParameterChanged() const;

sigc::signal<void> parameterChanged_;
sigc::signal<void()> parameterChanged_;

// added for debug
const std::string& name() const { return m_name; }
Expand Down
2 changes: 1 addition & 1 deletion Fireworks/Core/src/FWGUIEventDataAdder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class DataAdderTableManager : public FWTableManagerBase {
}
dataChanged();
}
sigc::signal<void, int> indexSelected_;
sigc::signal<void(int)> indexSelected_;

private:
void changeSelection(int iRow) {
Expand Down
5 changes: 3 additions & 2 deletions Fireworks/Core/src/FWGUIManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,9 @@ FWGUIManager::FWGUIManager(fireworks::Context* ctx, const FWViewManagerManager*
getAction(cmsshow::sLoadPartialConfig)
->activated.connect(sigc::mem_fun(*this, &FWGUIManager::promptForPartialLoadConfigurationFile));
getAction(cmsshow::sSaveConfig)->activated.connect(writeToPresentConfigurationFile_);

getAction(cmsshow::sSavePartialConfig)
->activated.connect(sigc::mem_fun(this, &FWGUIManager::savePartialToConfigurationFile));
->activated.connect(sigc::mem_fun(*this, &FWGUIManager::savePartialToConfigurationFile));
getAction(cmsshow::sSaveConfigAs)
->activated.connect(sigc::mem_fun(*this, &FWGUIManager::promptForSaveConfigurationFile));
getAction(cmsshow::sSavePartialConfigAs)
Expand All @@ -173,7 +174,7 @@ FWGUIManager::FWGUIManager(fireworks::Context* ctx, const FWViewManagerManager*
getAction(cmsshow::sShowObjInsp)->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::showModelPopup));

getAction(cmsshow::sBackgroundColor)
->activated.connect(sigc::mem_fun(m_context->colorManager(), &FWColorManager::switchBackground));
->activated.connect(sigc::mem_fun(*m_context->colorManager(), &FWColorManager::switchBackground));
getAction(cmsshow::sShowCommonInsp)->activated.connect(sigc::mem_fun(*m_guiManager, &FWGUIManager::showCommonPopup));

getAction(cmsshow::sShowInvMassDialog)
Expand Down
42 changes: 16 additions & 26 deletions Fireworks/Core/src/FWModelChangeManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -93,43 +93,32 @@ void FWModelChangeManager::endChanges() {
guard = true;
changeSignalsAreComing_();
}
FWItemChangeSignal& signal = m_itemChangeSignals[(*itChanges)->id()];
//loop over the slots ourself so we can control the behavior in case of a failure
FWItemChangeSignal::slot_list_type slots = signal.slots();
for (FWItemChangeSignal::slot_list_type::iterator itSlot = slots.begin(), itEnd = slots.end(); itSlot != itEnd;
++itSlot) {
try {
(*itSlot)(*itChanges);
} catch (const cms::Exception& iE) {
fwLog(fwlog::kError) << (*itChanges)->name() << " had the failure in process FWItemChanged signals\n"
<< iE.what() << std::endl;
} catch (const std::bad_alloc& iE) {
std::cerr << "Ran out of memory while processing " << (*itChanges)->name() << std::endl;
exit(1);
} catch (const std::exception& iE) {
fwLog(fwlog::kError) << (*itChanges)->name() << " had the failure in process FWItemChanged signals (2) \n"
<< iE.what() << std::endl;
}
try {
const FWEventItem* item = (*itChanges);
item->itemChanged_.emit(item);
} catch (const cms::Exception& iE) {
fwLog(fwlog::kError) << (*itChanges)->name() << " had the failure in process FWItemChanged signals\n"
<< iE.what() << std::endl;
} catch (const std::bad_alloc& iE) {
std::cerr << "Ran out of memory while processing " << (*itChanges)->name() << std::endl;
exit(1);
} catch (const std::exception& iE) {
fwLog(fwlog::kError) << (*itChanges)->name() << " had the failure in process FWItemChanged signals (2) \n"
<< iE.what() << std::endl;
}
}
m_itemChanges.clear();

for (size_t ci = 0, ce = m_changes.size(), si = 0; ci != ce; ++ci, ++si) {
FWModelIds& changes = m_changes[ci];
FWModelChangeSignal& signal = m_changeSignals[si];

if (not changes.empty()) {
if (!guard) {
// std::shared_ptr<FWModelChangeManager> done(this, &sendChangeSignalsAreDone);
guard = true;
changeSignalsAreComing_();
}
//loop over the slots ourself so we can control the behavior in case of a failure
FWModelChangeSignal::slot_list_type slots = signal.slots();
for (FWModelChangeSignal::slot_list_type::iterator itSlot = slots.begin(), itEnd = slots.end(); itSlot != itEnd;
++itSlot) {
try {
(*itSlot)(changes);
const FWEventItem* item = changes.begin()->item();
item->changed_.emit(changes);
} catch (const cms::Exception& iE) {
fwLog(fwlog::kError) << changes.begin()->item()->name()
<< " had the failure in process FWModelChangeSignals\n"
Expand All @@ -144,10 +133,11 @@ void FWModelChangeManager::endChanges() {
<< iE.what() << "\n";
}
}
changes.clear();
}
changes.clear();
}
}

if (guard)
sendChangeSignalsAreDone(this);
}
Expand Down
Loading