Project

General

Profile

Actions

Task #1299

closed

Enforce Interest/Data is created with make_shared

Added by Junxiao Shi over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Docs
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Interest class and Data class are not fully functional if they are not created with boost::make_shared.

To enforce this requirement, their constructors should be marked private, and a static method should be provided to create shared_ptr<Interest> and shared_ptr<Data>:

class Interest
{
public:
  static shared_ptr<Interest>
  create(const Name& name);

private:
  explicit
  Interest(const Name& name);
};
Actions

Also available in: Atom PDF