<commit_before>#ifndef     LIBXAOS_CORE_POINTERS_INTERNAL_CONTROLBLOCK_H
#define     LIBXAOS_CORE_POINTERS_INTERNAL_CONTROLBLOCK_H

namespace libxaos {
    namespace pointers {
        namespace internal { // an extra namespace.. just to deter outside use

            template<typename T>
            class ControlBlock {

                public:

                    enum ReferenceType {
                        STRONG,
                        WEAK
                    };

                    //! Constructs a ControlBlock from a T pointer
                    ControlBlock(T*);
                    ~ControlBlock();

                    //! Should not be copy constructed
                    ControlBlock(const ControlBlock<T>&) = delete;
                    //! Should not be copy assigned
                    ControlBlock<T>& operator=(const ControlBlock<T>&) = delete;
                    //! Should not be move constructed
                    ControlBlock(ControlBlock<T>&&) = delete;
                    //! Should not be move assigned.
                    CotnrolBlock<T>& operator=(ControlBlock<T>&&) = delete;

                    //! Returns the pointer
                    T* getPointer() const;

                    //! Increment reference
                    void incrementReference(ReferenceType);
                    //! Decrement reference
                    void decrementReference(ReferenceType);

                private:
                    T* _pointer;
                    int _strongReferences;
                    int _weakReferences;
            };

        }
    }<commit_msg>Fixed up the ControlBlock header a bit.<commit_after>#ifndef     LIBXAOS_CORE_POINTERS_INTERNAL_CONTROLBLOCK_H
#define     LIBXAOS_CORE_POINTERS_INTERNAL_CONTROLBLOCK_H

namespace libxaos {
    namespace pointers {
        namespace internal { // an extra namespace.. just to deter outside use

            //! An enum for differentiating between owners and observers
            enum ReferenceType {
                STRONG,
                WEAK
            };

            //! An enum for differentiating between pointer types.
            enum PointerType {
                PLAIN,
                ARRAY
            };

            /**
             *  @brief A ControlBlock handles the lifetime of a shared pointer.
             *
             *  THIS CLASS IS INTERNAL ONLY.  YOU SHOULD NOT BE USING IT.
             *
             *  A ControlBlock manages the lifetime of a shared pointer based on
             *  registered Strong and Weak references.  It deletes the held
             *  pointer based on those referencing itself.  Additionally, it
             *  manages its own lifetime and will destroy itself when there are
             *  no longer any shared pointers utilizing it.
             */
            template<typename T, PointerType P>
            class ControlBlock {

                public:

                    //! Constructs a ControlBlock from a T*
                    ControlBlock(T*);
                    ~ControlBlock();

                    //! Should not be copy constructed
                    ControlBlock(const ControlBlock<T, P>&) = delete;
                    //! Should not be copy assigned
                    ControlBlock<T, P>& operator=(const ControlBlock<T, P>&)
                            = delete;
                    //! Should not be move constructed
                    ControlBlock(ControlBlock<T, P>&&) = delete;
                    //! Should not be move assigned.
                    CotnrolBlock<T, P>& operator=(ControlBlock<T, P>&&)
                            = delete;

                    //! Returns the pointer
                    T* getPointer() const;

                    //! Increment reference
                    void incrementReference(ReferenceType);
                    //! Decrement reference
                    void decrementReference(ReferenceType);

                    //! Validates the internal pointer to be non-null
                    bool operator bool() const;

                private:
                    //! The held pointer
                    T* _pointer;
                    //! The number of strong shared pointers using this block.
                    int _strongReferences;
                    //! The number of weak shared pointers using this block.
                    int _weakReferences;
            };

        }
    }
{'fraction_non_alphanumeric': 0.06337709370755998, 'fraction_numerical': 0.0, 'mean_word_length': 1.2183734939759037, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1562019', 'n_tokens_mistral': 994, 'n_tokens_neox': 887, 'n_words': 309}