This file is indexed.

/usr/include/salome/PalmCouplingPolicy.hxx is in salome-kernel-dev 6.5.0-7ubuntu2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
//
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//

//  File   : PalmCouplingPolicy.hxx
//  Author : Eric Fayolle (EDF)
//  Module : KERNEL
// Modified by : $LastChangedBy$
// Date        : $LastChangedDate: 2007-01-29 16:12:41 +0100 (lun, 29 jan 2007) $
// Id          : $Id: PalmCouplingPolicy.hxx,v 1.3.2.1.10.2.12.1 2012-04-12 14:05:08 vsr Exp $
//
#ifndef _PALM_COUPLING_POLICIES_HXX_
#define _PALM_COUPLING_POLICIES_HXX_

#include <SALOMEconfig.h>

#include <CORBA.h>
#include <vector>
#include "DataIdFilter.hxx"
#include "DisplayPair.hxx"
#include "CouplingPolicy.hxx"

class PalmCouplingPolicy: public CouplingPolicy {

  // Objet de filtrage et conversion d'un TIME
  filtre_conversion filtre_convert_TIME ;
  // Objet de filtrage et conversion d'un TAG
  filtre_conversion filtre_convert_TAG ;

public:

  template <typename T_TIME, typename T_TAG >        class InternalDataIdContainer;
  template <typename T_TIME, typename T_TAG > friend class InternalDataIdContainer;

  filtre_conversion * get_filtre_convert_TIME() { return &filtre_convert_TIME; }
  filtre_conversion * get_filtre_convert_TAG()  { return &filtre_convert_TAG;  }
 
  // Classe DataId rassemblant les paramètres de la méthode PORT::put 
  // qui identifient l'instance d'une donnée pour Palm
  // Rem : Le DataId doit pouvoir être une key dans une map stl
  typedef CORBA::Long TimeType;
  typedef CORBA::Long TagType;
  typedef std::pair               < TimeType , TagType > DataId;
  typedef InternalDataIdContainer < TimeType , TagType > DataIdContainer;

  TimeType getTime(const DataId &dataId) const { return dataId.first;}
  TagType  getTag (const DataId &dataId) const { return dataId.second;}

  // Container qui permet d'itérer sur l'ensemble des DataId générés par les
  // eventuelles conversions
  template <typename T_TIME, typename T_TAG > class InternalDataIdContainer {

    std::vector<T_TIME>  _lTime;
    std::vector<T_TAG>   _lTag;
    
    // Interdit la construction d'un container vide car
    // aucune méthode d'ajout d'élément n'a été implémentée
    InternalDataIdContainer() {}
 
  public:
    typedef DataId                                   value_type;
    template <typename TTIME, typename TTAG>   class DataIdIterator;
    typedef  DataIdIterator<T_TIME, T_TAG>           iterator;                  
    typedef value_type &                             reference;
    typedef value_type const &                       const_reference;
 
    // Remplit le container d'identificateurs après avoir appliqué
    // les filtres/convertions  des paramètres "TIMEs" et des "TAGs"
    InternalDataIdContainer(const DataId & dataId, const PalmCouplingPolicy & policy ) {
      std::cout << "----Cst ----  InternalDataIdContainer(const DataId & dataId..) " << dataId <<std::endl;
      policy.filtre_convert_TIME.applique_filtre_conversion(dataId.first, _lTime);
      int c=0;
      for(std::vector<CORBA::Long>::iterator i=_lTime.begin();i!=_lTime.end();++i)
        std::cout << "_lTime["<< c++ << "] : " << *i << std::endl;
      policy.filtre_convert_TAG.applique_filtre_conversion(dataId.second, _lTag);
      c=0;
      for(std::vector<CORBA::Long>::iterator i=_lTag.begin();i!=_lTag.end();++i)
        std::cout << "_lTag["<< c++ << "] : " << *i << std::endl;
    }

    // Pas encore testé
    InternalDataIdContainer(std::vector<T_TIME> const & lTime, std::vector<T_TAG> const & lTag):
      _lTime(lTime),_lTag(lTag) {}
  

    // Pas encore testé
    InternalDataIdContainer( InternalDataIdContainer const & pc):
      _lTime(pc._lTime), _lTag(pc._lTag) {}


    // Pas encore testé
    InternalDataIdContainer & operator=(const InternalDataIdContainer & pc) {
      if (this != &pc) { _lTime=pc._lTime; _lTag=pc._lTag; }
      return *this;
    }
    
    virtual ~InternalDataIdContainer() {}

    iterator begin() { return iterator(*this);  }
    iterator end()   { return iterator(*this,_lTime.end(),_lTag.end()); }
    // En Palm les deux paramètres du couple (temps,tag) doivent
    // exister (un seul paramètre n'est pas recevable) 
    bool     empty() const { return _lTime.empty() || _lTag.empty(); }

    // Définition de l'itérateur du container
    template <typename TTIME, typename TTAG> class DataIdIterator {

    public:

      typedef typename std::vector<TTIME>::const_iterator ItTime;
      typedef typename std::vector<TTAG >::const_iterator ItTag;

    private:
      ItTime _itTime;
      ItTag  _itTag;
      const InternalDataIdContainer<TTIME,TTAG> & _pc;
      DataIdIterator() {}

    public:
 
 
      // Pas encore testé
      DataIdIterator(const InternalDataIdContainer<TTIME,TTAG> & pc):
        _pc(pc),_itTime(pc._lTime.begin()),_itTag(pc._lTag.begin()) {}
      DataIdIterator(const InternalDataIdContainer<TTIME,TTAG> & pc, ItTime itTime, ItTag itTag):
        _pc(pc),_itTime(itTime),_itTag(itTag) {}
      // Pas encore testé
      DataIdIterator(const DataIdIterator & dIt):
        _pc(dIt._pc),_itTime(dIt._itTime),_itTag(dIt._itTag) {}
      ~DataIdIterator() {}
      

      // Pas encore testé
      DataIdIterator & operator=(const DataIdIterator & dIt) {
        if (this != &dIt) {
          _pc=dIt._pc;_itTime=dIt._itTime;_itTag=dIt._itTag;
        }
        return *this;
      }

      DataId operator*() const {
        std::cout << "-------- operator*(),  *_itTime : " << *_itTime << " *_itTag " <<  *_itTag <<std::endl;
        return DataId(*_itTime,*_itTag); }
   
      bool operator==( const DataIdIterator  & dIt) const {
        return (_itTime == dIt._itTime) && (_itTag == dIt._itTag) && (&_pc == &dIt._pc);
      }

      bool operator!=( const DataIdIterator  & dIt) const { 
        return (_itTime != dIt._itTime) || (_itTag != dIt._itTag) || (&_pc != &dIt._pc);
      }

      // Notation préfixé
      DataIdIterator & operator++() {
        if ( _itTag != _pc._lTag.end() ) { 
          ++_itTag;
          if (_itTag != _pc._lTag.end() ) return *this;
        }
        if ( _itTime != _pc._lTime.end() )  { 
          ++_itTime;
          if (_itTime != _pc._lTime.end() ) _itTag=_pc._lTag.begin();
        }
        return *this;
      }

      // Notation postfixé
      DataIdIterator operator++(int fake) { 
        DataIdIterator tmpIt=*this; ++*this; return tmpIt; 
      }
      
    }; //Fin de la classe de l'itérateur
  };   //Fin de la classe du container



};

#endif