Const modifiers
This commit is contained in:
parent
3bdcdd808b
commit
42220579df
|
@ -146,7 +146,7 @@ void PART_LIB::EnableBuffering( bool aEnable )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PART_LIB::GetAliasNames( wxArrayString& aNames )
|
void PART_LIB::GetAliasNames( wxArrayString& aNames ) const
|
||||||
{
|
{
|
||||||
m_plugin->EnumerateSymbolLib( aNames, fileName.GetFullPath(), m_properties.get() );
|
m_plugin->EnumerateSymbolLib( aNames, fileName.GetFullPath(), m_properties.get() );
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ void PART_LIB::GetAliasNames( wxArrayString& aNames )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PART_LIB::GetAliases( std::vector<LIB_ALIAS*>& aAliases )
|
void PART_LIB::GetAliases( std::vector<LIB_ALIAS*>& aAliases ) const
|
||||||
{
|
{
|
||||||
m_plugin->EnumerateSymbolLib( aAliases, fileName.GetFullPath(), m_properties.get() );
|
m_plugin->EnumerateSymbolLib( aAliases, fileName.GetFullPath(), m_properties.get() );
|
||||||
|
|
||||||
|
@ -164,7 +164,7 @@ void PART_LIB::GetAliases( std::vector<LIB_ALIAS*>& aAliases )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PART_LIB::GetEntryTypePowerNames( wxArrayString& aNames )
|
void PART_LIB::GetEntryTypePowerNames( wxArrayString& aNames ) const
|
||||||
{
|
{
|
||||||
std::vector<LIB_ALIAS*> aliases;
|
std::vector<LIB_ALIAS*> aliases;
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ void PART_LIB::GetEntryTypePowerNames( wxArrayString& aNames )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LIB_ALIAS* PART_LIB::FindAlias( const wxString& aName )
|
LIB_ALIAS* PART_LIB::FindAlias( const wxString& aName ) const
|
||||||
{
|
{
|
||||||
LIB_ALIAS* alias = m_plugin->LoadSymbol( fileName.GetFullPath(), aName, m_properties.get() );
|
LIB_ALIAS* alias = m_plugin->LoadSymbol( fileName.GetFullPath(), aName, m_properties.get() );
|
||||||
|
|
||||||
|
@ -194,13 +194,13 @@ LIB_ALIAS* PART_LIB::FindAlias( const wxString& aName )
|
||||||
// symbols. This allows the symbol library table conversion tool to determine the
|
// symbols. This allows the symbol library table conversion tool to determine the
|
||||||
// correct library where the symbol was found.
|
// correct library where the symbol was found.
|
||||||
if( alias && alias->GetPart() && !alias->GetPart()->GetLib() )
|
if( alias && alias->GetPart() && !alias->GetPart()->GetLib() )
|
||||||
alias->GetPart()->SetLib( this );
|
alias->GetPart()->SetLib( const_cast<PART_LIB*>( this ) );
|
||||||
|
|
||||||
return alias;
|
return alias;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LIB_PART* PART_LIB::FindPart( const wxString& aName )
|
LIB_PART* PART_LIB::FindPart( const wxString& aName ) const
|
||||||
{
|
{
|
||||||
LIB_ALIAS* alias = FindAlias( aName );
|
LIB_ALIAS* alias = FindAlias( aName );
|
||||||
|
|
||||||
|
@ -211,7 +211,7 @@ LIB_PART* PART_LIB::FindPart( const wxString& aName )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PART_LIB::HasPowerParts()
|
bool PART_LIB::HasPowerParts() const
|
||||||
{
|
{
|
||||||
// return true if at least one power part is found in lib
|
// return true if at least one power part is found in lib
|
||||||
std::vector<LIB_ALIAS*> aliases;
|
std::vector<LIB_ALIAS*> aliases;
|
||||||
|
|
|
@ -401,21 +401,21 @@ public:
|
||||||
*
|
*
|
||||||
* @param aNames - String array to place entry names into.
|
* @param aNames - String array to place entry names into.
|
||||||
*/
|
*/
|
||||||
void GetAliasNames( wxArrayString& aNames );
|
void GetAliasNames( wxArrayString& aNames ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load a vector with all the entries in this library.
|
* Load a vector with all the entries in this library.
|
||||||
*
|
*
|
||||||
* @param aAliases - vector to receive the aliases.
|
* @param aAliases - vector to receive the aliases.
|
||||||
*/
|
*/
|
||||||
void GetAliases( std::vector<LIB_ALIAS*>& aAliases );
|
void GetAliases( std::vector<LIB_ALIAS*>& aAliases ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load a string array with the names of entries of type POWER in this library.
|
* Load a string array with the names of entries of type POWER in this library.
|
||||||
*
|
*
|
||||||
* @param aNames - String array to place entry names into.
|
* @param aNames - String array to place entry names into.
|
||||||
*/
|
*/
|
||||||
void GetEntryTypePowerNames( wxArrayString& aNames );
|
void GetEntryTypePowerNames( wxArrayString& aNames ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find #LIB_ALIAS by \a aName.
|
* Find #LIB_ALIAS by \a aName.
|
||||||
|
@ -423,7 +423,7 @@ public:
|
||||||
* @param aName - Name of entry, case sensitive.
|
* @param aName - Name of entry, case sensitive.
|
||||||
* @return #LIB_ALIAS* if found. NULL if not found.
|
* @return #LIB_ALIAS* if found. NULL if not found.
|
||||||
*/
|
*/
|
||||||
LIB_ALIAS* FindAlias( const wxString& aName );
|
LIB_ALIAS* FindAlias( const wxString& aName ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find part by \a aName.
|
* Find part by \a aName.
|
||||||
|
@ -434,7 +434,7 @@ public:
|
||||||
* @param aName - Name of part, case sensitive.
|
* @param aName - Name of part, case sensitive.
|
||||||
* @return LIB_PART* - part if found, else NULL.
|
* @return LIB_PART* - part if found, else NULL.
|
||||||
*/
|
*/
|
||||||
LIB_PART* FindPart( const wxString& aName );
|
LIB_PART* FindPart( const wxString& aName ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add \a aPart entry to library.
|
* Add \a aPart entry to library.
|
||||||
|
@ -481,14 +481,14 @@ public:
|
||||||
*
|
*
|
||||||
* @return wxString - Full library file name with path and extension.
|
* @return wxString - Full library file name with path and extension.
|
||||||
*/
|
*/
|
||||||
wxString GetFullFileName() { return fileName.GetFullPath(); }
|
wxString GetFullFileName() const { return fileName.GetFullPath(); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function GetLogicalName
|
* Function GetLogicalName
|
||||||
* returns the logical name of the library.
|
* returns the logical name of the library.
|
||||||
* @return wxString - The logical name of this library.
|
* @return wxString - The logical name of this library.
|
||||||
*/
|
*/
|
||||||
const wxString GetLogicalName()
|
const wxString GetLogicalName() const
|
||||||
{
|
{
|
||||||
/* for now is the filename without path or extension.
|
/* for now is the filename without path or extension.
|
||||||
|
|
||||||
|
@ -518,7 +518,7 @@ public:
|
||||||
* @return true if at least one power part is found in lib
|
* @return true if at least one power part is found in lib
|
||||||
* Useful to select or list only libs containing power parts
|
* Useful to select or list only libs containing power parts
|
||||||
*/
|
*/
|
||||||
bool HasPowerParts();
|
bool HasPowerParts() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,7 @@ void CMP_TREE_MODEL_ADAPTER::AttachTo( wxDataViewCtrl* aDataViewCtrl )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
LIB_ID CMP_TREE_MODEL_ADAPTER::GetAliasFor( wxDataViewItem aSelection ) const
|
LIB_ID CMP_TREE_MODEL_ADAPTER::GetAliasFor( const wxDataViewItem& aSelection ) const
|
||||||
{
|
{
|
||||||
auto node = ToNode( aSelection );
|
auto node = ToNode( aSelection );
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ LIB_ID CMP_TREE_MODEL_ADAPTER::GetAliasFor( wxDataViewItem aSelection ) const
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int CMP_TREE_MODEL_ADAPTER::GetUnitFor( wxDataViewItem aSelection ) const
|
int CMP_TREE_MODEL_ADAPTER::GetUnitFor( const wxDataViewItem& aSelection ) const
|
||||||
{
|
{
|
||||||
auto node = ToNode( aSelection );
|
auto node = ToNode( aSelection );
|
||||||
return node ? node->Unit : 0;
|
return node ? node->Unit : 0;
|
||||||
|
|
|
@ -212,7 +212,7 @@ public:
|
||||||
*
|
*
|
||||||
* @return alias, or nullptr if none is selected
|
* @return alias, or nullptr if none is selected
|
||||||
*/
|
*/
|
||||||
LIB_ID GetAliasFor( wxDataViewItem aSelection ) const;
|
LIB_ID GetAliasFor( const wxDataViewItem& aSelection ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the unit for the given item.
|
* Return the unit for the given item.
|
||||||
|
@ -223,7 +223,7 @@ public:
|
||||||
* @return Unit, or zero if the alias itself is selected. Return valid is
|
* @return Unit, or zero if the alias itself is selected. Return valid is
|
||||||
* invalid if GetAliasFor() returns nullptr.
|
* invalid if GetAliasFor() returns nullptr.
|
||||||
*/
|
*/
|
||||||
int GetUnitFor( wxDataViewItem aSelection ) const;
|
int GetUnitFor( const wxDataViewItem& aSelection ) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the number of components loaded in the tree.
|
* Return the number of components loaded in the tree.
|
||||||
|
|
Loading…
Reference in New Issue