type.ToString() == "list" ||
type.ToString() == "array") {
if (direction == ParameterType::Direction::IN)
- return "rpc_port_" + type.ToString() + "_h ";
+ return "rpc_port_" + GetFullNameFromType(type) + "_h ";
else
- return "rpc_port_" + type.ToString() + "_h *";
+ return "rpc_port_" + GetFullNameFromType(type) + "_h *";
}
if (type.ToString() == "string") {
void CHeaderGeneratorBase::GenStructures(std::ofstream& stream) {
for (auto& i : GetDocument().GetBlocks()) {
- if (i->GetType() != Block::TYPE_STRUCTURE)
- continue;
-
- const Structure &st = static_cast<const Structure&>(*i);
- GenStructure(stream, st);
- for (auto& j : st.GetElements().GetElms()) {
- auto& t = j->GetType();
- AddStructureFromType(t);
+ if (i->GetType() == Block::TYPE_STRUCTURE) {
+ const Structure &st = static_cast<const Structure&>(*i);
+ GenStructure(stream, st);
+ for (auto& j : st.GetElements().GetElms()) {
+ auto& t = j->GetType();
+ AddStructureFromType(t);
+ }
+ } else {
+ const Interface &inf = static_cast<const Interface&>(*i);
+ for (auto& d : inf.GetDeclarations().GetDecls()) {
+ for (auto& p : d->GetParameters().GetParams()) {
+ if (TypeIsDelegator(inf, p->GetParameterType().GetBaseType()))
+ continue;
+ AddStructureFromType(p->GetParameterType().GetBaseType());
+ }
+ }
}
}
if (decl.GetMethodType() == Declaration::MethodType::SYNC &&
decl.GetType().ToString() != "void") {
- str += GetReturnTypeString(decl.GetType()) + " ret = ";
+ str += GetReturnTypeString(decl.GetType()) + "ret = ";
}
str += "context->callback." + decl.GetID() + "(context";
str += "rpc_port_" + decl.GetID() + "_h h";
for (auto& i : decl.GetParameters().GetParams()) {
str += ", ";
- str += ConvertTypeToString(i->GetParameterType().GetDirection(),
+ str += GetParamTypeString(i->GetParameterType().GetDirection(),
i->GetParameterType().GetBaseType()) + i->GetID();
}
return str;
for (auto& i : decl.GetParameters().GetParams()) {
str += ", ";
str += GetParamTypeString(i->GetParameterType().GetDirection(),
- i->GetParameterType().GetBaseType()) + " " + i->GetID();
+ i->GetParameterType().GetBaseType()) + i->GetID();
}
return str;
}