| 1234567891011121314151617181920212223242526272829 |
- // package log_dict_topic -- хранитель топиков для логирования.
- package log_dict_topic
- import (
- "gitp78su.ipnodns.ru/svi/kern/v4/d0"
- "gitp78su.ipnodns.ru/svi/kern/v4/d2/lti/bus_ent/topic"
- "gitp78su.ipnodns.ru/svi/kern/v4/d2/lti/bus_spec"
- )
- type LogDictTopic struct {
- *d0.MSafeMutex
- dict map[topic.ATopic]struct{}
- client bus_spec.IBusClient
- }
- // NewLogDictTopic -- возвращает новый словарь топиков для логирования.
- func NewLogDictTopic(owner *d0.LOwner, clientBus bus_spec.IBusClient) *d0.Result[*LogDictTopic] {
- d0.If(owner==nil).Hassert("NewLogDictTopic(): owner == nil")
- if clientBus == nil {
- err := d0.LetErr(owner, "NewLogDictTopic(): clientBus == nil")
- return d0.ResErr[*LogDictTopic](err)
- }
- sf := &LogDictTopic{
- MSafeMutex: d0.MutSafeMutex(),
- dict: map[topic.ATopic]struct{}{},
- client: clientBus,
- }
- return d0.ResOk(sf)
- }
|