What is the general naming convention for RAII classes?

In C ++, when using a resource initialization pattern (RAII), are there general conventions for naming classes?

In my case, I have classes that do the following types of things, and I would like names that might make sense to the first reader when viewing one of them on the stack:

  • Class to suppress registration (which can be nested).
  • A class to house an observer.
  • A class for writing the current object being processed for the current thread.
  • A derived class for processing an object in addition to the behavior of the base class (in the previous line).

As the first cut, I used such names (in the corresponding order above), but I hope to improve them:

  • class SuppressLogger
  • class ScopedObserver
  • class WithCurrentObject
  • class WithObjectProcessed: public WithCurrentObject
+6
source share
1 answer

RAII should be used in all languages. Since this should be the default, no naming convention exists.

+9
source

Source: https://habr.com/ru/post/919519/


All Articles