Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class MyContainedClass {
- };
- class MyClass {
- public:
- MyContainedClass * getElement() {
- // ...
- std::list<MyContainedClass>::iterator it = ... // retrieve somehow
- return &(*it);
- }
- // other methods
- private:
- std::list<MyContainedClass> m_contained;
- };
- const MyContainedClass * getElement() const {
- // ...
- std::list<MyContainedClass>::const_iterator it = ... // retrieve somehow
- return &(*it);
- }
- const MyContainedClass & getElement() const {
- // ...
- std::list<MyContainedClass>::const_iterator it = ... // retrieve somehow
- return *it;
- }
- std::list<MyContainedClass>::const_iterator getElement() const {
- // ...
- std::list<MyContainedClass>::const_iterator it = ... // retrieve somehow
- return it;
- }
- const MyContainedClass * getElement() const {
- // ...
- std::list<MyContainedClass>::const_iterator it = ... // retrieve somehow
- return &(*it);
- }
- const MyContainedClass& getElement() const {
- // ...
- std::list<MyContainedClass>::const_iterator it = ... // retrieve somehow
- return *it;
- }
- class Paragraph {
- public:
- // getters and setters for private fields
- private:
- FONTFACET m_fontFace;
- FONTSIZET m_fontSize;
- CONTENTT m_content;
- }
- class Document {
- public:
- Paragraph * NewParagraph();
- void DeleteParagraph(Paragraph * p);
- Paragraph * GetParagraph(/*parameters to select particular paragraph*/) {
- std::list<Paragraph>::iterator it = // retrieve according to arguments
- return &(*it);
- }
- // getters and setters of document's properties
- private:
- std::list<Paragraph> m_paragraphs;
- // other properties of Document
- }
- class ToolbarParagraphEditor: public ToolbarWidget {
- public:
- // implementation.
- private:
- Paragraph * m_paragraph;
- }
- class DialogParagraphEditor: public DialogWidget {
- public:
- // implementation
- private:
- Paragraph * m_paragraph;
- }
- class ParagraphSelectionDialog: public DialogWidget {
- // implementation
- private:
- std::list<Paragraph *> m_selectedParagraphs; // Selection dialog doesn't own paragraphs
- }
Add Comment
Please, Sign In to add comment