Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getter/setter customization #59

Open
zhyh2010 opened this issue Jul 25, 2023 · 1 comment
Open

Getter/setter customization #59

zhyh2010 opened this issue Jul 25, 2023 · 1 comment

Comments

@zhyh2010
Copy link

I found #11, but it does not work for me.
my code is like this:
class WatchData {
public:
std::string GetSubscribeName() const { return SubscribeName; }
void SetSubscribeName(const std::string &subscribeName) {
mSubscribeName = subscribeName;
}

private:
std::string mSubscribeName;
};

however, when use the plugin, i cannot generate code above.
Is there any way to generate code for customization

@zhyh2010
Copy link
Author

also, sometimes , i want to generate code like this, add inline const before Get Method
class WatchData {
public:
inline const std::string &GetSubscribeName() const { return SubscribeName; }
inline void SetSubscribeName(const std::string &subscribeName) {
mSubscribeName = subscribeName;
}

inline const std::string &GetWatchJobName() const { return WatchJobName; }
inline void SetWatchJobName(const std::string &watchJobName) {
mWatchJobName = watchJobName;
}

inline const std::vectorstd::string &GetWatchValueList() const {
return WatchValueList;
}
inline void
SetWatchValueList(const std::vectorstd::string &watchValueList) {
mWatchValueList = watchValueList;
}

inline const std::vectorstd::string &GetAttributeNames() const {
return AttributeNames;
}
inline void
SetAttributeNames(const std::vectorstd::string &attributeNames) {
mAttributeNames = attributeNames;
}

private:
std::string mSubscribeName;
std::string mWatchJobName;
std::vectorstd::string mWatchValueList;
std::vectorstd::string mAttributeNames;
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant