Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:18

0001 /*
0002  * Copyright (c) 2019 Opticks Team. All Rights Reserved.
0003  *
0004  * This file is part of Opticks
0005  * (see https://bitbucket.org/simoncblyth/opticks).
0006  *
0007  * Licensed under the Apache License, Version 2.0 (the "License"); 
0008  * you may not use this file except in compliance with the License.  
0009  * You may obtain a copy of the License at
0010  *
0011  *   http://www.apache.org/licenses/LICENSE-2.0
0012  *
0013  * Unless required by applicable law or agreed to in writing, software 
0014  * distributed under the License is distributed on an "AS IS" BASIS, 
0015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
0016  * See the License for the specific language governing permissions and 
0017  * limitations under the License.
0018  */
0019 
0020 
0021 #include <string>
0022 #include <csignal>
0023 #include "SMap.hh"
0024 
0025 #include "SYSRAP_LOG.hh"
0026 #include "OPTICKS_LOG.hh"
0027 
0028 int main(int argc, char** argv)
0029 {
0030     OPTICKS_LOG(argc, argv);
0031 
0032     typedef std::string K ; 
0033     typedef unsigned long long V ; 
0034 
0035     std::map<K,V> m ; 
0036 
0037     V v =  0xdeadbeefdeadbeefull ; 
0038 
0039     m["hello"] = v ; 
0040     m["world"] = v ; 
0041     m["other"] = 0x4full ; 
0042     m["yo"] = 0xffffull ; 
0043 
0044 
0045     unsigned nv = SMap<K,V>::ValueCount(m, v) ; 
0046 
0047     bool nv_expect = nv == 2 ;
0048     assert( nv_expect );
0049     if(!nv_expect) std::raise(SIGINT); 
0050 
0051     bool dump = true ; 
0052 
0053     std::vector<K> keys ; 
0054     SMap<K,V>::FindKeys(m, keys, v, dump ) ; 
0055 
0056     assert( keys.size() == 2 ) ;
0057 
0058 
0059     return 0 ;
0060 }