\hypertarget{namespacedc__hash}{}\section{dc\+\_\+hash Module Reference}
\label{namespacedc__hash}\index{dc\+\_\+hash@{dc\+\_\+hash}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{namespacedc__hash_a7d9a5d4a503134389508700c73120842}{dchashget0} (hashv, key, value, found)
\item 
subroutine \hyperlink{namespacedc__hash_a40056e07ec8111f8550bdce57e138e95}{dchashdelete0} (hashv, key)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{namespacedc__hash_a40056e07ec8111f8550bdce57e138e95}\label{namespacedc__hash_a40056e07ec8111f8550bdce57e138e95}} 
\index{dc\+\_\+hash@{dc\+\_\+hash}!dchashdelete0@{dchashdelete0}}
\index{dchashdelete0@{dchashdelete0}!dc\+\_\+hash@{dc\+\_\+hash}}
\subsubsection{\texorpdfstring{dchashdelete0()}{dchashdelete0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+hash\+::dchashdelete0 (\begin{DoxyParamCaption}\item[{type(hash), intent(inout)}]{hashv,  }\item[{character($\ast$), intent(in), optional}]{key }\end{DoxyParamCaption})}



Definition at line 362 of file dc\+\_\+hash.\+f90.


\begin{DoxyCode}
362     \textcolor{comment}{!}
363     \textcolor{comment}{! *hashv* のキー *key* およびその関連する値を削除します.}
364     \textcolor{comment}{! *hashv* 内に *key* が見つからない場合には何もしません.}
365     \textcolor{comment}{!}
366     \textcolor{comment}{! *key* が省略される場合には *hashv* 内の全てのキーと値を}
367     \textcolor{comment}{! 削除します.}
368     \textcolor{comment}{!}
369     \textcolor{keywordtype}{implicit none}
370     \textcolor{keywordtype}{type}(hash), \textcolor{keywordtype}{intent(inout)} :: hashv
371     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional} :: key
372     \textcolor{keywordtype}{type}(hash\_internal), \textcolor{keywordtype}{pointer} :: hash\_table\_tmp(:) => null()
373     \textcolor{keywordtype}{integer} :: table\_size, i, j
374     \textcolor{keywordtype}{logical} :: found
375     \textcolor{keywordtype}{character(STRING)} :: search\_value
376   \textcolor{keywordflow}{continue}
377     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(key)) \textcolor{keywordflow}{then}
378       \textcolor{keyword}{call }dchashget(hashv, key, search\_value, found)
379       table\_size = dchashnumber(hashv)
380       \textcolor{keywordflow}{if} (found .and. table\_size > 1) \textcolor{keywordflow}{then}
381         \textcolor{keyword}{allocate}(hash\_table\_tmp(table\_size))
382         hash\_table\_tmp = hashv % hash\_table
383         \textcolor{keyword}{deallocate}(hashv % hash\_table)
384         \textcolor{keyword}{allocate}(hashv % hash\_table(table\_size - 1))
385         j = 1
386         \textcolor{keywordflow}{do} i = 1, table\_size
387           \textcolor{keywordflow}{if} (trim(hash\_table\_tmp(i) % key) /= trim(key)) \textcolor{keywordflow}{then}
388             hashv % hash\_table(j) % key = hash\_table\_tmp(i) % key
389             hashv % hash\_table(j) % value = hash\_table\_tmp(i) % value
390             j = j + 1
391 \textcolor{keywordflow}{          end if}
392 \textcolor{keywordflow}{        end do}
393         
394         \textcolor{keyword}{deallocate}(hash\_table\_tmp)
395       \textcolor{keywordflow}{elseif} (found .and. table\_size == 1) \textcolor{keywordflow}{then}
396         \textcolor{keyword}{deallocate}(hashv % hash\_table)
397 \textcolor{keywordflow}{      end if}
398     \textcolor{keywordflow}{else}
399       \textcolor{keywordflow}{if} (\textcolor{keyword}{associated}(hashv % hash\_table)) \textcolor{keyword}{deallocate}(hashv % hash\_table)
400 \textcolor{keywordflow}{    end if}
401 
\end{DoxyCode}
\mbox{\Hypertarget{namespacedc__hash_a7d9a5d4a503134389508700c73120842}\label{namespacedc__hash_a7d9a5d4a503134389508700c73120842}} 
\index{dc\+\_\+hash@{dc\+\_\+hash}!dchashget0@{dchashget0}}
\index{dchashget0@{dchashget0}!dc\+\_\+hash@{dc\+\_\+hash}}
\subsubsection{\texorpdfstring{dchashget0()}{dchashget0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+hash\+::dchashget0 (\begin{DoxyParamCaption}\item[{type(hash), intent(inout)}]{hashv,  }\item[{character($\ast$), intent(in)}]{key,  }\item[{character($\ast$), intent(out)}]{value,  }\item[{logical, intent(out), optional}]{found }\end{DoxyParamCaption})}



Definition at line 326 of file dc\+\_\+hash.\+f90.



References dc\+\_\+types\+::string.


\begin{DoxyCode}
326     \textcolor{comment}{!}
327     \textcolor{comment}{! *hashv* のキー *key* に関連する値を *value* に返します.}
328     \textcolor{comment}{! *key* に関連する値が存在しない場合は *value* に}
329     \textcolor{comment}{! 空文字を返します.}
330     \textcolor{comment}{!}
331     \textcolor{comment}{! *found* を与えると, *key* に関連する値が見つからなかった}
332     \textcolor{comment}{! 場合に .false. を返します.}
333     \textcolor{comment}{!}
334     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}
335     \textcolor{keywordtype}{implicit none}
336     \textcolor{keywordtype}{type}(hash), \textcolor{keywordtype}{intent(inout)} :: hashv
337     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}  :: key
338     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(out)} :: value
339     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional} :: found
340     \textcolor{keywordtype}{character(STRING)} :: search\_key, search\_value
341     \textcolor{keywordtype}{logical} :: end
342   \textcolor{keywordflow}{continue}
343     \textcolor{keyword}{call }dchashrewind(hashv)
344     \textcolor{keywordflow}{do}
345       \textcolor{keyword}{call }dchashnext(hashv, search\_key, search\_value, end)
346       \textcolor{keywordflow}{if} (end) \textcolor{keywordflow}{then}
347         \textcolor{keywordtype}{value} = \textcolor{stringliteral}{''}
348         \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(found)) found = .false.
349         \textcolor{keywordflow}{exit}
350 \textcolor{keywordflow}{      end if}
351 
352       \textcolor{keywordflow}{if} (trim(search\_key) == trim(key)) \textcolor{keywordflow}{then}
353         \textcolor{keywordtype}{value} = search\_value
354         \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(found)) found = .true.
355         \textcolor{keywordflow}{exit}
356 \textcolor{keywordflow}{      end if}
357 \textcolor{keywordflow}{    enddo}
358 
\end{DoxyCode}
