KiCad PCB EDA Suite
PNS::ITEM_SET::ENTRY Struct Reference

#include <pns_itemset.h>

Public Member Functions

 ENTRY (ITEM *aItem, bool aOwned=false)
 
 ENTRY (const ENTRY &aOther)
 
 ~ENTRY ()
 
bool operator== (const ENTRY &b) const
 
bool operator< (const ENTRY &b) const
 
ENTRYoperator= (const ENTRY &aOther)
 
 operator ITEM * () const
 

Public Attributes

ITEMitem
 
bool owned
 

Detailed Description

Definition at line 39 of file pns_itemset.h.

Constructor & Destructor Documentation

◆ ENTRY() [1/2]

PNS::ITEM_SET::ENTRY::ENTRY ( ITEM aItem,
bool  aOwned = false 
)
inline

Definition at line 41 of file pns_itemset.h.

41 :
42 item( aItem ),
43 owned( aOwned )
44 {}

◆ ENTRY() [2/2]

PNS::ITEM_SET::ENTRY::ENTRY ( const ENTRY aOther)
inline

Definition at line 46 of file pns_itemset.h.

47 {
48 owned = aOther.owned;
49
50 if( aOther.owned )
51 item = aOther.item->Clone();
52 else
53 item = aOther.item;
54 }
virtual ITEM * Clone() const =0
Return a deep copy of the item.

References PNS::ITEM::Clone(), item, and owned.

◆ ~ENTRY()

PNS::ITEM_SET::ENTRY::~ENTRY ( )
inline

Definition at line 56 of file pns_itemset.h.

57 {
58 if( owned )
59 delete item;
60 }

References item, and owned.

Member Function Documentation

◆ operator ITEM *()

PNS::ITEM_SET::ENTRY::operator ITEM * ( ) const
inline

Definition at line 84 of file pns_itemset.h.

85 {
86 return item;
87 }

References item.

◆ operator<()

bool PNS::ITEM_SET::ENTRY::operator< ( const ENTRY b) const
inline

Definition at line 67 of file pns_itemset.h.

68 {
69 return item < b.item;
70 }

References item.

◆ operator=()

ENTRY & PNS::ITEM_SET::ENTRY::operator= ( const ENTRY aOther)
inline

Definition at line 72 of file pns_itemset.h.

73 {
74 owned = aOther.owned;
75
76 if( aOther.owned )
77 item = aOther.item->Clone();
78 else
79 item = aOther.item;
80
81 return *this;
82 }

References PNS::ITEM::Clone(), item, and owned.

◆ operator==()

bool PNS::ITEM_SET::ENTRY::operator== ( const ENTRY b) const
inline

Definition at line 62 of file pns_itemset.h.

63 {
64 return item == b.item;
65 }

References item.

Member Data Documentation

◆ item

ITEM* PNS::ITEM_SET::ENTRY::item

Definition at line 89 of file pns_itemset.h.

Referenced by ENTRY(), operator ITEM *(), operator<(), operator=(), operator==(), and ~ENTRY().

◆ owned

bool PNS::ITEM_SET::ENTRY::owned

Definition at line 90 of file pns_itemset.h.

Referenced by ENTRY(), operator=(), and ~ENTRY().


The documentation for this struct was generated from the following file: