stream << ReplaceAll(CB_VERSION_DEF, "[VERSION]", FULLVER);
}
+bool CppGeneratorBase::IsMovableType(const BaseType& type,
+ ParameterType::Direction dir) {
+ for (auto& i : GetDocument().GetBlocks()) {
+ if (i->GetType() != Block::TYPE_INTERFACE)
+ continue;
+ Interface& iface = static_cast<Interface&>(*i);
+
+ if (IsDelegateType(iface, type))
+ return true;
+
+ if (dir != ParameterType::Direction::IN)
+ continue;
+
+ if (type.ToString() == "string" ||
+ type.ToString() == "file" ||
+ type.ToString() == "bundle" ||
+ type.GetMetaType() != nullptr ||
+ type.IsUserDefinedType())
+ return true;
+ }
+
+ return false;
+}
+
} // namespace tidl
void GenLogTag(std::ofstream& stream, std::string id);
void GenLogDefinition(std::ofstream& stream);
void GenVersionDefinition(std::ofstream& stream);
+ bool IsMovableType(const BaseType& type, ParameterType::Direction dir);
private:
std::string GetSetter(const Element& ele);
if (pt.GetDirection() == ParameterType::Direction::OUT) {
d += ConvertTypeToString(pt.GetBaseType()) + " " + v + ";\n";
}
- if (IsDelegateType(pt.GetBaseType())) {
+ if (IsMovableType(pt.GetBaseType(), pt.GetDirection())) {
m += "std::move(";
m += v;
m += ")";