gaussianrecurrence commented on a change in pull request #806:
URL: https://github.com/apache/geode-native/pull/806#discussion_r662180518



##########
File path: cppcache/src/PdxInstanceImpl.hpp
##########
@@ -211,35 +210,36 @@ class PdxInstanceImpl : public WritablePdxInstance {
 
   void operator=(const PdxInstanceImpl& other) = delete;
 
-  std::shared_ptr<PdxType> getPdxType() const;
+  std::shared_ptr<PdxType> getPdxType(Pool* pool) const;
 
-  void updatePdxStream(uint8_t* newPdxStream, int len);
+  int32_t getTypeId() const;
+
+  void updatePdxStream(std::vector<uint8_t> stream);
+
+ protected:
+  const std::vector<uint8_t>& getPdxStream() const;
 
  private:
-  std::vector<uint8_t> m_buffer;
-  int m_typeId;
+  mutable std::vector<uint8_t> m_buffer;
+  mutable int32_t m_typeId;

Review comment:
       This is by convention member variables that are lazily initializated are 
supposed to be mutable. The reason is because once initialized they are 
supposed to be immutable, but sadly there is no support from the language for 
lazy initialization, so that's the way it's usually done.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to