Skip to content

Commit e75670b

Browse files
committed
Some renaming
1 parent 79404f4 commit e75670b

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/app/CommandHandler.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class CommandHandler
329329
template <typename CommandData>
330330
CHIP_ERROR AddResponseData(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData)
331331
{
332-
DataModel::ObjectEncodableToTLV<CommandData> encoder(aData);
332+
DataModel::DirectEncodableToTLV<CommandData> encoder(aData);
333333
return AddResponseData(aRequestCommandPath, CommandData::GetCommandId(), encoder);
334334
}
335335

@@ -372,7 +372,7 @@ class CommandHandler
372372
template <typename CommandData>
373373
void AddResponse(const ConcreteCommandPath & aRequestCommandPath, const CommandData & aData)
374374
{
375-
DataModel::ObjectEncodableToTLV<CommandData> encodable(aData);
375+
DataModel::DirectEncodableToTLV<CommandData> encodable(aData);
376376
return AddResponse(aRequestCommandPath, CommandData::GetCommandId(), encodable);
377377
}
378378

src/app/data-model/EncodableToTLV.h

+6-5
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,21 @@ class EncodableToTLV
3535
virtual CHIP_ERROR EncodeTo(TLV::TLVWriter & writer, TLV::Tag tag) = 0;
3636
};
3737

38-
/// An `EncodableToTLV` that uses `DataModel::Encode` to encode things.
38+
/// An `EncodableToTLV` that uses `DataModel::Encode` to encode things in one call.
3939
///
40-
/// Generally useful to encode things like <ClusterName>::Commands::<CommandName>::Type
41-
/// structures.
40+
/// Applicable to any type for which `chip::app::DataModel::Encode` works. In
41+
/// particular, types like <ClusterName>::Commands::<CommandName>::Type
42+
/// can be used as a type here.
4243
template <typename T>
43-
class ObjectEncodableToTLV : public EncodableToTLV
44+
class DirectEncodableToTLV : public EncodableToTLV
4445
{
4546
public:
4647
/// Encodes the given value via `DataModel::Encode` when the underlying
4748
/// encode is called.
4849
///
4950
/// LIFETIME NOTE: uses a reference to value, so value must live longer than
5051
/// this object.
51-
ObjectEncodableToTLV(const T & value) : mValue(value) {}
52+
DirectEncodableToTLV(const T & value) : mValue(value) {}
5253

5354
CHIP_ERROR EncodeTo(TLV::TLVWriter & writer, TLV::Tag tag) override { return DataModel::Encode(writer, tag, mValue); }
5455

0 commit comments

Comments
 (0)