Skip to content
nucularmoo edited this page Mar 6, 2018 · 11 revisions

Shared Pointers

Explanation of the contents of a topic page @ Week 1 Topic 1

Back to Week 1

Objective: Managing object copies with shared pointers (does not have to be between threads)

Comment: The general problem is that an object owner does not know, when it can delete an object, which is possibly used somewhere else in the program (typically in another thread, but not necessarily). This problem should be clear to motivate attendees about the usefulness of shared pointers. The important objective to learn is that anyone can "delete" the local reference safely by decreasing the reference count.

Comment: It's too early to talk about threads, I think. We should just emphasise benefits of sharing in different code blocks in a single threaded application.

Comment: Let's postpone threads completely at this point, even though it's a typical use case.

Beginner

  • No, really, what are pointers?!
  • What is memory management?
  • Why is memory management important?
  • What is a shared object?

Intermediate

  • How to manage the lifetime of shared objects?
  • What are Shared Pointers?
  • When are Shared Pointers used in Qt?

Expert


Course material content

Managing the lifetime of shared objects

Shared Pointers

Using Shared Pointers in Qt


Exhaustive reference material mentioned in this topic

Further reading topics/links:

Clone this wiki locally