Changeset c8cb0d for src/Actions


Ignore:
Timestamp:
Dec 26, 2025, 9:40:14 PM (6 weeks ago)
Author:
Frederik Heber <frederik.heber@…>
Branches:
Candidate_v1.7.1, stable
Children:
033646
Parents:
f2d5ce
git-author:
Frederik Heber <frederik.heber@…> (12/10/25 16:15:28)
git-committer:
Frederik Heber <frederik.heber@…> (12/26/25 21:40:14)
Message:

Streamlines channel creation in Observables.

  • CodePatterns is now version 1.3.4.
  • we no longer need to add the channels manually in the cstor of a class that derives from Observable. Instead, we just need to pass the maximum number of channels (as they are typically enumerated anyway) and they are generated and added.
  • added mutex protection when inserting.
  • adjusted class Relay to forward similar convenience cstors.
  • adjusted all call sites in molecuilder.
Location:
src/Actions
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/ActionQueue.cpp

    rf2d5ce rc8cb0d  
    6262
    6363ActionQueue::ActionQueue() :
    64     Observable("ActionQueue"),
     64    Observable("ActionQueue", NotificationType_MAX),
    6565    AR(new ActionRegistry()),
    6666    history(new ActionHistory),
     
    7272#endif
    7373    dryrun_flag(false)
    74 {
    75   // channels of observable
    76   Channels *OurChannel = new Channels;
    77   Observable::insertNotificationChannel( std::make_pair(static_cast<Observable *>(this), OurChannel) );
    78   // add instance for each notification type
    79   for (size_t type = 0; type < NotificationType_MAX; ++type)
    80     OurChannel->addChannel(type);
    81 }
     74{}
    8275
    8376ActionQueue::~ActionQueue()
  • src/Actions/ActionStatusList.cpp

    rf2d5ce rc8cb0d  
    4242
    4343ActionStatusList::ActionStatusList() :
    44   Observable("ActionStatusList")
    45 {
    46   Channels *OurChannel = new Channels;
    47   Observable::insertNotificationChannel( std::make_pair(static_cast<Observable *>(this), OurChannel) );
    48   // add instance for each notification type
    49   for (size_t type = 0; type < NotificationType_MAX; ++type)
    50     OurChannel->addChannel(type);
    51 }
     44  Observable("ActionStatusList", NotificationType_MAX)
     45{}
    5246
    5347ActionStatusList::~ActionStatusList()
Note: See TracChangeset for help on using the changeset viewer.