28using css::uno::Reference;
29using css::uno::XInterface;
43 uno::Reference< uno::XInterface > xRef( rInterface, uno::UNO_QUERY );
45 IdMap_t::const_iterator aIter;
48 return (*aIter).first;
52 OUString aId =
"id" + OUString::number(
mnNextId++ );
53 return (*
maEntries.emplace( aId, xRef ).first).first;
59 IdMap_t::const_iterator aIter;
63 uno::Reference< uno::XInterface > xRef( rInterface, uno::UNO_QUERY );
67 return rIdentifier != (*aIter).first;
75 maEntries.insert( IdMap_t::value_type( rIdentifier, xRef ) );
79 sal_Int32
nLength = rIdentifier.getLength();
82 if(
nLength < 2 || p[0] !=
'i' || p[1] !=
'd' )
90 if( (*p <
'0') || (*p >
'9') )
108 IdMap_t::const_iterator aIter;
111 return (*aIter).first;
115 static const OUString aEmpty;
122 IdMap_t::const_iterator aIter;
125 return (*aIter).second;
129 static const Reference< XInterface > aEmpty;
136 uno::Reference< uno::XInterface > xRef( rInterface, uno::UNO_QUERY );
138 const IdMap_t::const_iterator aEnd(
maEntries.end() );
139 rIter = std::find_if(
maEntries.begin(), aEnd, [&xRef](
const IdMap_t::value_type& rItem) {
144 return rItem.second.get() == xRef.get();
147 return rIter != aEnd;
166 const OUString& rIdentifier,
167 const css::uno::Reference< css::uno::XInterface >& rInterface )
169 Reserved_t::const_iterator aIt;
182 Reserved_t::const_iterator aDummy;
187 const OUString& rIdentifier,
188 Reserved_t::const_iterator& rIter )
const
const OUString & getIdentifier(const css::uno::Reference< css::uno::XInterface > &rInterface) const
bool registerReservedReference(const OUString &rIdentifier, const css::uno::Reference< css::uno::XInterface > &rInterface)
registers the given uno object with reserved identifier.
const OUString & registerReference(const css::uno::Reference< css::uno::XInterface > &rInterface)
returns a unique identifier for the given uno object.
UnoInterfaceToUniqueIdentifierMapper()
const css::uno::Reference< css::uno::XInterface > & getReference(const OUString &rIdentifier) const
bool findIdentifier(const OUString &rIdentifier, IdMap_t::const_iterator &rIter) const
bool findReserved(const OUString &rIdentifier) const
bool reserveIdentifier(const OUString &rIdentifier)
reserves an identifier for later registration.
bool findReference(const css::uno::Reference< css::uno::XInterface > &rInterface, IdMap_t::const_iterator &rIter) const
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)