* limitations under the License.
*/
+#include <utility>
+
#include "idlc/attribute.h"
#include "idlc/type.h"
namespace tidl {
-Attribute::Attribute(const std::string& id, BaseType* type,
- const std::string& comments, unsigned line)
- : id_(id), type_(type), comments_(comments), line_(line) {}
+Attribute::Attribute(std::string id, BaseType* type,
+ std::string comments, unsigned line)
+ : id_(std::move(id)), type_(type), comments_(std::move(comments)),
+ line_(line) {}
const std::string& Attribute::GetID() const {
return id_;
#include <list>
#include <memory>
-#include "type.h"
-#include "parameter.h"
+#include "idlc/type.h"
+#include "idlc/parameter.h"
namespace tidl {
class Attribute {
public:
- Attribute(const std::string& id, BaseType* type,
- const std::string& comments, unsigned line);
+ Attribute(std::string id, BaseType* type,
+ std::string comments, unsigned line);
const std::string& GetID() const;
const BaseType& GetType() const;
* limitations under the License.
*/
+#include <utility>
+
#include "idlc/type.h"
#include "idlc/block.h"
namespace tidl {
-Block::Block(const std::string& id, Block::Type type,
- const std::string& comments, unsigned line)
- : id_(id), type_(type), comments_(comments), line_(line) {
-}
+Block::Block(std::string id, Block::Type type,
+ std::string comments, unsigned line)
+ : id_(std::move(id)), type_(type), comments_(std::move(comments)),
+ line_(line) {}
const std::string& Block::GetID() const {
return id_;
#include <string>
#include <memory>
-#include "declaration.h"
+#include "idlc/declaration.h"
namespace tidl {
TYPE_STRUCTURE,
};
- Block(const std::string& id, Block::Type type, const std::string& comments,
+ Block(std::string id, Block::Type type, std::string comments,
unsigned line);
virtual ~Block() = default;
* limitations under the License.
*/
+#include <utility>
+
#include "idlc/declaration.h"
#include "idlc/type.h"
#include "idlc/parameter.h"
namespace tidl {
-Declaration::Declaration(const std::string& id, BaseType* ret_type,
- Parameters* params, const std::string& comments,
+Declaration::Declaration(std::string id, BaseType* ret_type,
+ Parameters* params, std::string comments,
unsigned line, bool async)
- : id_(id),
+ : id_(std::move(id)),
ret_type_(ret_type),
params_(params),
- comments_(comments),
+ comments_(std::move(comments)),
line_(line),
async_(async) {}
class Declaration {
public:
- Declaration(const std::string& id, BaseType* ret_type, Parameters* params,
- const std::string& comments, unsigned line, bool async = false);
+ Declaration(std::string id, BaseType* ret_type, Parameters* params,
+ std::string comments, unsigned line, bool async = false);
const std::string& GetID() const;
const BaseType& GetType() const;
virtual void OnInterfaceEnd(std::ofstream& stream, const std::string& id) = 0;
virtual void OnDeclarationGen(std::ofstream& stream, const std::string& id,
const Parameters& args,
- const BaseType& ret,
- const std::string& comments) = 0;
+ const BaseType& ret,
+ const std::string& comments) = 0;
virtual void OnStructureBegin(std::ofstream& stream,
const std::string& id,
const std::string& comments) = 0;
* limitations under the License.
*/
+#include <utility>
+
#include "idlc/declaration.h"
#include "idlc/interface.h"
#include "idlc/block.h"
namespace tidl {
-Interface::Interface(const std::string& id, Declarations* decls,
- const std::string& comments, unsigned line)
- : Block::Block(id, Block::TYPE_INTERFACE, comments, line), decls_(decls) {
-}
+Interface::Interface(std::string id, Declarations* decls, std::string comments,
+ unsigned line)
+ : Block::Block(std::move(id), Block::TYPE_INTERFACE,
+ std::move(comments), line), decls_(decls) {}
const Declarations& Interface::GetDeclarations() const {
return *decls_;
class Interface : public Block {
public:
- Interface(const std::string& id, Declarations* decls,
- const std::string& comments, unsigned line);
+ Interface(std::string id, Declarations* decls, std::string comments,
+ unsigned line);
const Declarations& GetDeclarations() const;
* limitations under the License.
*/
+#include <utility>
+
#include "idlc/parameter.h"
#include "idlc/type.h"
namespace tidl {
-Parameter::Parameter(const std::string& id, ParameterType* type, unsigned line)
- : type_(type), id_(id), line_(line) {}
+Parameter::Parameter(std::string id, ParameterType* type, unsigned line)
+ : type_(type), id_(std::move(id)), line_(line) {}
const std::string& Parameter::GetID() const {
return id_;
class Parameter {
public:
- Parameter(const std::string& id, ParameterType* type, unsigned line);
+ Parameter(std::string id, ParameterType* type, unsigned line);
const std::string& GetID() const;
const ParameterType& GetParameterType() const;
* limitations under the License.
*/
+#include <utility>
+
#include "idlc/attribute.h"
#include "idlc/structure.h"
#include "idlc/block.h"
namespace tidl {
-Structure::Structure(const std::string& id, Attributes* attrs,
- const std::string& comments, unsigned line)
- : Block::Block(id, Block::TYPE_STRUCTURE, comments, line), attrs_(attrs) {
-}
+Structure::Structure(std::string id, Attributes* attrs, std::string comments,
+ unsigned line)
+ : Block::Block(std::move(id), Block::TYPE_STRUCTURE,
+ std::move(comments), line), attrs_(attrs) {}
const Attributes& Structure::GetAttributes() const {
return *attrs_;
class Structure : public Block {
public:
- Structure(const std::string& id, Attributes* attrs,
- const std::string& comments, unsigned line);
+ Structure(std::string id, Attributes* attrs, std::string comments,
+ unsigned line);
const Attributes& GetAttributes() const;
void OnDeclarationGen(std::ofstream& stream, const std::string& id,
const Parameters& args, const BaseType& ret,
- const std::string& comments) override;
+ const std::string& comments) override;
void OnInitGen(std::ofstream& stream) override;
void OnFiniGen(std::ofstream& stream) override;
void OnInterfaceBegin(std::ofstream& stream,
const std::string& id,
- const std::string& comments) override;
+ const std::string& comments) override;
void OnInterfaceEnd(std::ofstream& stream, const std::string& id) override;
void OnAttributeGen(std::ofstream& stream, const std::string& id,
const BaseType& type,
*/
#include <iostream>
+#include <utility>
+
#include "idlc/type.h"
namespace tidl {
-Token::Token(const std::string& name, const std::string& comments)
- : name_(name), comments_(comments) {
+Token::Token(std::string name, std::string comments)
+ : name_(std::move(name)), comments_(std::move(comments)) {
}
-BaseType::BaseType(const std::string& name, const std::string& comments,
+BaseType::BaseType(std::string name, std::string comments,
bool user_defined)
- : Token(name, comments), user_defined_(user_defined) {
+ : Token(std::move(name), std::move(comments)), user_defined_(user_defined) {
}
void BaseType::SetMetaType(BaseType* type) {
class Token {
public:
- Token(const std::string& name, const std::string& comments);
+ Token(std::string name, std::string comments);
virtual ~Token() = default;
virtual std::string ToString() const { return name_; }
class BaseType : public Token {
public:
- explicit BaseType(const std::string& name, const std::string& comments,
+ explicit BaseType(std::string name, std::string comments,
bool user_defined = false);
void SetMetaType(BaseType* type);
const BaseType& GetMetaType() const {