Skip to content

Latest commit

 

History

History
145 lines (121 loc) · 3.64 KB

convention.md

File metadata and controls

145 lines (121 loc) · 3.64 KB

Conventions

  • header file:

        #ifndef FLS_HEADER_HPP
        #define FLS_HEADER_HPP
         
        namespace fastlanes {
        /*--------------------------------------------------------------------------------------------------------------------*/
        class ForwardDeclared;
        /*--------------------------------------------------------------------------------------------------------------------*/
        class Header {
        };
        
        } // namespace fastlanes
        #endif // FLS_HEADER_HPP
    
  • rules:

    • no struct! always class.
    • no pragma! include header.
  • Naming convention

    • m_* -> member
    • *_t -> type
    • n_*-> number of
    • *_p -> raw ptr
    • *_up -> unique_ptr
    • *_sp -> shared_ptr
    • *_stp -> single_thread_ptr
    • *_s -> string
    • *_sz -> size
    • *_bsz -> size
    • *_md -> metadata
    • *_o -> offset
    • *_v -> value
    • *_arr -> C-arr
    • *_vec -> std::vec
    • *_idx -< index
    • *_krl -> kernel
    • *_trd -> cpu thread
    • Can be combined
    • *_c_p -> pointer to a counter
  • 3 word system!

    • tab -> table
    • dat -> data
    • col -> column
    • arr -> array
    • idx -> index
    • cor -> core
    • cmn -> common
    • psr -> parser
    • prm -> primitive
    • stt -> statistic
    • lmt -> limit
  • Alias

    • sp -> std::shared_pointer
    • up -> std::unique_pointer
    • count-t -> uint64_t
  • Type Name

    • T -> t
    • AT -> arrow type
    • PT -> parquet type, physical type
  • Class Layout (0.0.1)

      template <typename T>
      class Class {
                  /* PUBLIC: */
      public:     /* Constructors */
        Class(const Class&)             = delete;
        Class& operator=(const Class&)  = delete;
        Class(const Class&&)            = delete;
        Class& operator=(const Class&&) = delete;
    
      public:     /* Member functions */
      public:     /* Members */
            
                  /* PROTECTED: */
      protected:  /* Constructors */
      protected:  /* Member Functions */
      protected:  /* Members */
            
                  /* PRIVATE: */
      private:    /* Constructors */
      private:    /* Member Functions */
      private:    /* Members */
      };
    • I before a class name means an Interface class
    • maybe more structure?
        class C {
        C(const C&) = default;
        C(C&&) = default;
        C& operator=(const C&) & = default;
        C& operator=(C&&) & = default;
        virtual ~C() { }
        };
  • Comment Tag

    • [op] -> optimization opportunity
    • [fixme] -> fixme later
    • [todo] -> todo
  • Comment Block

    /*--------------------------------------------------------------------------------------------------------------------*\
     * Implementation
    \*--------------------------------------------------------------------------------------------------------------------*/
    
    Options
    # Options: -------------------------------------------------------------------------------------------------------------
    
  • Single Line Delimitor

    /*--------------------------------------------------------------------------------------------------------------------*/
  • Log

    FLS_LOG_1MSG(" MY MESSAGE !")
  • Forward declare

    /*--------------------------------------------------------------------------------------------------------------------*/
    class FastLanes;
    /*--------------------------------------------------------------------------------------------------------------------*/