<html><head><meta http-equiv="Content-Type" content="text/html charset=gb18030"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>So the problem is definitely with includes.  In ca.h you include ca-entry.h and in ca-entry.h you are including ca.h, which creates an error you're observing.</div><div><br></div><div>In PIT implementation, pit-entry.h does not include pit.h at all, it merely has a forward declaration of the class (<a href="https://github.com/NDN-Routing/ndnSIM/blob/master/model/pit/ndn-pit-entry.h#L45">https://github.com/NDN-Routing/ndnSIM/blob/master/model/pit/ndn-pit-entry.h#L45</a>).  You can do a similar trick.</div><div><br></div><div>---</div><div>Alex</div><div><br></div>PS<div>If you don't mind, can you also CC ndnsim mailing list in your replies. Thanks.</div><div><br></div><div><br><div><div>On Feb 7, 2013, at 4:45 PM, "独善其身 " <<a href="mailto:aaronishere@qq.com">aaronishere@qq.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi, Alex<br>The CA header is below <br><br>#ifndef _NDN_CA_H_<br>#define _NDN_CA_H_<br><br>#include "ns3/object.h"<br>#include "ns3/nstime.h"<br>#include "ns3/event-id.h"<br><br>#include "ndn-ca-entry.h"<br><br>namespace ns3 {<br>namespace ndn {<br><br>class L3Protocol;<br>class Face;<br>class ContentObjectHeader;<br>//class InterestHeader;<br>class CAHeader;<br><br><br>/**<br> * \ingroup ndn<br> * \brief Class implementing Pending Interests Table<br> */<br>class Ca : public Object<br>{<br>public:<br>  /**<br>   * \brief Interface ID<br>   *<br>   * \return interface ID<br>   */<br>  static TypeId GetTypeId ();<br><br>  /**<br>   * \brief PIT constructor<br>   */<br>  Ca ();<br><br>  /**<br>   * \brief Destructor<br>   */<br>  virtual ~Ca ();<br><br>  /**<br>   * \brief Find corresponding PIT entry for the given content name<br>   *<br>   * Not that this call should be repeated enough times until it return 0.<br>   * This way all records with shorter or equal prefix as in content object will be found<br>   * and satisfied.<br>   *<br>   * \param prefix Prefix for which to lookup the entry<br>   * \returns smart pointer to PIT entry. If record not found,<br>   *          returns 0<br>   */<br>  virtual Ptr<ca::Entry><br>  Lookup (const ContentObjectHeader &header) = 0;<br><br>  /**<br>   * \brief Find a PIT entry for the given content interest<br>   * \param header parsed interest header<br>   * \returns iterator to Pit entry. If record not found,<br>   *          return end() iterator<br>   */<br>  virtual Ptr<ca::Entry><br>  Lookup (const CAHeader &header) = 0;<br><br>  /**<br>   * @brief Creates a PIT entry for the given interest<br>   * @param header parsed interest header<br>   * @returns iterator to Pit entry. If record could not be created (e.g., limit reached),<br>   *          return end() iterator<br>   *<br>   * Note. This call assumes that the entry does not exist (i.e., there was a Lookup call before)<br>   */<br>  virtual Ptr<ca::Entry><br>  Create (Ptr<const CAHeader> header) = 0;<br>  <br>  /**<br>   * @brief Mark PIT entry deleted<br>   * @param entry PIT entry<br>   *<br>   * Effectively, this method removes all incoming/outgoing faces and set<br>   * lifetime +m_PitEntryDefaultLifetime from Now ()<br>   */<br>  virtual void<br>  MarkErased (Ptr<ca::Entry> entry) = 0;<br><br>  /**<br>   * @brief Print out PIT contents for debugging purposes<br>   *<br>   * Note that there is no definite order in which entries are printed out<br>   */<br>  virtual void<br>  Print (std::ostream &os) const = 0;<br><br>  /**<br>   * @brief Get number of entries in PIT<br>   */<br>  virtual uint32_t<br>  GetSize () const = 0;<br><br>  /**<br>   * @brief Return first element of FIB (no order guaranteed)<br>   */<br>  virtual Ptr<ca::Entry><br>  Begin () = 0;<br><br>  /**<br>   * @brief Return item next after last (no order guaranteed)<br>   */<br>  virtual Ptr<ca::Entry><br>  End () = 0;<br><br>  /**<br>   * @brief Advance the iterator<br>   */<br>  virtual Ptr<ca::Entry><br>  Next (Ptr<ca::Entry>) = 0;<br>  <br>  /**<br>   * @brief Static call to cheat python bindings<br>   */<br>  static inline Ptr<Ca><br>  GetCa (Ptr<Object> node);<br><br>protected:<br>  // configuration variables. Check implementation of GetTypeId for more details<br>  Time    m_CaEntryPruningTimout;<br>};<br><br>inline std::ostream&<br>operator<< (std::ostream& os, const Ca &ca)<br>{<br>  ca.Print (os);<br>  return os;<br>}<br><br>inline Ptr<Ca><br>Ca::GetCa (Ptr<Object> node)<br>{<br>  return node->GetObject<Ca> ();<br>}<br><br>} // namespace ndn<br>} // namespace ns3<br><br>#endif    /* NDN_PIT_H */<br><div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>Sender:</b> "alexander.afanasyev"<<a href="mailto:alexander.afanasyev@ucla.edu">alexander.afanasyev@ucla.edu</a>>;</div><div><b>Send time:</b> Friday, Feb 8, 2013 0:51 AM</div><div><b>To:</b> "独善其身"<<a href="mailto:aaronishere@qq.com">aaronishere@qq.com</a>>; <wbr></div><div><b>Cc:</b> "ndnsim"<<a href="mailto:ndnsim@lists.cs.ucla.edu">ndnsim@lists.cs.ucla.edu</a>>; <wbr></div><div><b>Subject:</b> Re: question for PIT</div></div><div><br></div>Hi<br><br>It would help if you can send also header for your ndn-ca.  I suspect there some missing forward declarations of your Entry class (as you're including ndn-ca inside ndn-ca-entry).  <br><br>---<br>Alex<br><br>On Feb 7, 2013, at 1:14 AM, "独善其身 " <<a href="mailto:aaronishere@qq.com">aaronishere@qq.com</a>> wrote:<br><br>> Hi, Alex <br>> I want to imitate the PIT to establish a new table called ca. I just copy the PIT and rename as the ca.  And under the file ca, I replaced the keyword Pit/pit as Ca/ca , Interest/interest as Cah/cah. I also add the ndn-cah.cc and ndn-cah.h under the model and corresponding header files in the wscript. However when I compiled, it errors like bellow.<br>> <br>> In file included from ./ns3/ndn-ca-entry.h:28:0,<br>>                  from ./ns3/ndnSIM-module.h:16,<br>>                  from ../src/ndnSIM/examples/ndn-tree-app-delay-tracer.cc:25:<br>> ./ns3/ndn-ca.h:77:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:77:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:77:24: error: template argument 1 is invalid<br>> ./ns3/ndn-ca.h:86:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:86:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:86:24: error: template argument 1 is invalid<br>> ./ns3/ndn-ca.h:97:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:97:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:97:24: error: template argument 1 is invalid<br>> ./ns3/ndn-ca.h:108:19: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:108:19: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:108:28: error: template argument 1 is invalid<br>> ./ns3/ndn-ca.h:127:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:127:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:127:24: error: template argument 1 is invalid<br>> ./ns3/ndn-ca.h:133:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:133:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:133:24: error: template argument 1 is invalid<br>> ./ns3/ndn-ca.h:139:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:139:15: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:139:24: error: template argument 1 is invalid<br>> ./ns3/ndn-ca.h:140:13: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:140:13: error: ‘Entry’ is not a member of ‘ns3::ndn::ca’<br>> ./ns3/ndn-ca.h:140:22: error: template argument 1 is invalid<br>> <br>> here is the ndn-ca-entry.h, the Entry is included in ns3::ndn::ca. I'm not sure why?<br>> #ifndef _NDN_CA_ENTRY_H_<br>> #define _NDN_CA_ENTRY_H_<br>> #include "ns3/ptr.h"<br>> #include "ns3/simple-ref-count.h"<br>> #include "ns3/ndn-fib.h"<br>> #include "ns3/ndn-ca.h"//////////////////<br>> #include "ns3/ndn-name-components.h"//////////////////<br>> #include "ns3/ndn-ca-entry-incoming-face.h"<br>> #include "ns3/ndn-ca-entry-outgoing-face.h"<br>> ........<br>> namespace ns3 {<br>> namespace ndn {<br>> class Ca;<br>> namespace fw { class Tag; }<br>> namespace ca {<br>> class i_face {};<br>> class i_retx {};<br>> class Entry : public SimpleRefCount<Entry><br>> {<br>> public:<br>>   typedef std::set< IncomingFace > in_container; ///< @brief incoming faces container type<br>>   typedef in_container::iterator in_iterator;                ///< @brief iterator to incoming faces<br>>   typedef std::set< OutgoingFace > out_container; ///< @brief outgoing faces container type<br>>   typedef out_container::iterator out_iterator;              ///< @brief iterator to outgoing faces<br>>   typedef std::set< uint32_t > nonce_container;  ///< @brief nonce container type<br>>   ............................<br>> }<br>> Thanks for help!<br></div></blockquote></div><br></div></body></html>