Skip to content

Commit 786976a

Browse files
committed
mqtt: renaming
1 parent 87bab71 commit 786976a

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

mqtt_streaming_module/include/mqtt_streaming_module/mqtt_json_receiver_fb_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ class MqttJsonReceiverFbImpl final : public MqttBaseFb
4646
std::string topicForSubscribing;
4747
static std::atomic<int> localIndex;
4848

49-
DictObjectPtr<IDict, IString, IFunctionBlockType> baseFbTypes;
49+
DictObjectPtr<IDict, IString, IFunctionBlockType> nestedFbTypes;
5050
std::vector<FunctionBlockPtr> nestedFunctionBlocks;
5151

5252
static std::string generateLocalId();
5353

54-
void initBaseFunctionalBlocks();
54+
void initNestedFbTypes();
5555

5656
void createSignals() override;
5757
void clearSubscribedTopic() override;

mqtt_streaming_module/include/mqtt_streaming_module/mqtt_root_fb_impl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ class MqttRootFbImpl : public FunctionBlock
5252
DictPtr<IString, IFunctionBlockType> onGetAvailableFunctionBlockTypes() override;
5353
FunctionBlockPtr onAddFunctionBlock(const StringPtr& typeId, const PropertyObjectPtr& config) override;
5454

55-
void initBaseFunctionalBlocks();
55+
void initNestedFbTypes();
5656
void initMqttSubscriber();
5757
void initConnectionStatus();
5858
void initProperties(const PropertyObjectPtr& config);
5959
void readProperties();
6060
bool waitForConnection(const int timeoutMs);
6161

62-
DictObjectPtr<IDict, IString, IFunctionBlockType> baseFbTypes;
62+
DictObjectPtr<IDict, IString, IFunctionBlockType> nestedFbTypes;
6363

6464
StatusHelper<ConnectionStatus> connectionStatus;
6565

mqtt_streaming_module/src/mqtt_json_receiver_fb_impl.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ MqttJsonReceiverFbImpl::MqttJsonReceiverFbImpl(const ContextPtr& ctx,
2020
: MqttBaseFb(ctx, parent, type, generateLocalId(), subscriber, config),
2121
jsonDataWorker(loggerComponent)
2222
{
23-
initBaseFunctionalBlocks();
23+
initNestedFbTypes();
2424
if (config.assigned())
2525
initProperties(populateDefaultConfig(type.createDefaultConfig(), config));
2626
else
@@ -122,13 +122,13 @@ std::string MqttJsonReceiverFbImpl::generateLocalId()
122122
return std::string(MQTT_LOCAL_JSON_FB_ID_PREFIX + std::to_string(localIndex++));
123123
}
124124

125-
void MqttJsonReceiverFbImpl::initBaseFunctionalBlocks()
125+
void MqttJsonReceiverFbImpl::initNestedFbTypes()
126126
{
127-
baseFbTypes = Dict<IString, IFunctionBlockType>();
127+
nestedFbTypes = Dict<IString, IFunctionBlockType>();
128128
// Add a function block type for manual JSON configuration
129129
{
130130
const auto fbType = MqttJsonDecoderFbImpl::CreateType();
131-
baseFbTypes.set(fbType.getId(), fbType);
131+
nestedFbTypes.set(fbType.getId(), fbType);
132132
}
133133
}
134134

@@ -290,16 +290,16 @@ bool MqttJsonReceiverFbImpl::setTopic(std::string topic)
290290

291291
DictPtr<IString, IFunctionBlockType> MqttJsonReceiverFbImpl::onGetAvailableFunctionBlockTypes()
292292
{
293-
return baseFbTypes;
293+
return nestedFbTypes;
294294
}
295295

296296
FunctionBlockPtr MqttJsonReceiverFbImpl::onAddFunctionBlock(const StringPtr& typeId, const PropertyObjectPtr& config)
297297
{
298298

299299
FunctionBlockPtr nestedFunctionBlock;
300-
if (baseFbTypes.hasKey(typeId))
300+
if (nestedFbTypes.hasKey(typeId))
301301
{
302-
auto fbTypePtr = baseFbTypes.getOrDefault(typeId);
302+
auto fbTypePtr = nestedFbTypes.getOrDefault(typeId);
303303
if (fbTypePtr.getName() == JSON_DECODER_FB_NAME)
304304
{
305305
nestedFunctionBlock = createWithImplementation<IFunctionBlock, MqttJsonDecoderFbImpl>(context, functionBlocks, fbTypePtr, config);

mqtt_streaming_module/src/mqtt_root_fb_impl.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ MqttRootFbImpl::MqttRootFbImpl(const ContextPtr& ctx, const ComponentPtr& parent
3030
initComponentStatus();
3131
initConnectionStatus();
3232
initProperties(config);
33-
initBaseFunctionalBlocks();
33+
initNestedFbTypes();
3434
initMqttSubscriber();
3535

3636
if (!waitForConnection(connectTimeout))
@@ -58,24 +58,24 @@ void MqttRootFbImpl::removed()
5858
}
5959
}
6060

61-
void MqttRootFbImpl::initBaseFunctionalBlocks()
61+
void MqttRootFbImpl::initNestedFbTypes()
6262
{
63-
baseFbTypes = Dict<IString, IFunctionBlockType>();
63+
nestedFbTypes = Dict<IString, IFunctionBlockType>();
6464
// Add a function block type for manual JSON configuration
6565
{
6666
const auto fbType = MqttJsonReceiverFbImpl::CreateType();
67-
baseFbTypes.set(fbType.getId(), fbType);
67+
nestedFbTypes.set(fbType.getId(), fbType);
6868
}
6969
// Add a function block type for raw MQTT messages
7070
{
7171
const auto fbType = MqttRawReceiverFbImpl::CreateType();
72-
baseFbTypes.set(fbType.getId(), fbType);
72+
nestedFbTypes.set(fbType.getId(), fbType);
7373
}
7474

7575
// Add a function block type for MQTT publisher
7676
{
7777
const auto fbType = MqttPublisherFbImpl::CreateType();
78-
baseFbTypes.set(fbType.getId(), fbType);
78+
nestedFbTypes.set(fbType.getId(), fbType);
7979
}
8080
}
8181

@@ -176,16 +176,16 @@ bool MqttRootFbImpl::waitForConnection(const int timeoutMs)
176176

177177
DictPtr<IString, IFunctionBlockType> MqttRootFbImpl::onGetAvailableFunctionBlockTypes()
178178
{
179-
return baseFbTypes;
179+
return nestedFbTypes;
180180
}
181181

182182
FunctionBlockPtr MqttRootFbImpl::onAddFunctionBlock(const StringPtr& typeId, const PropertyObjectPtr& config)
183183
{
184184
FunctionBlockPtr nestedFunctionBlock;
185185
{
186-
if (baseFbTypes.hasKey(typeId))
186+
if (nestedFbTypes.hasKey(typeId))
187187
{
188-
auto fbTypePtr = baseFbTypes.getOrDefault(typeId);
188+
auto fbTypePtr = nestedFbTypes.getOrDefault(typeId);
189189
if (fbTypePtr.getName() == RAW_FB_NAME)
190190
{
191191
nestedFunctionBlock = createWithImplementation<IFunctionBlock, MqttRawReceiverFbImpl>(context, functionBlocks, fbTypePtr, subscriber, config);

0 commit comments

Comments
 (0)