First, strict inequality is not possible with linear programming. You can however express
f(x) <= y
cplex->getValue(x) is a double so f(x) <= y is a boolean. At any rate, cplex->getValue() is only available after you have a solution so it should never be part of your model, unless you are solving it iteratively. To get a IloRange, you need to rewrite f(x) to accept an IloNumVar as it's parameter and to return an IloExpr. For example, if you have something like
double f(double x) {return 2*x;}
You need a version
IloExpr f(IloNumVarx) {return 2*x;}
Then you can write
IloRange rng = (f(x) <= y);
If you are using cplex (or any linear programming solver), f(x) can only be a linear function or convex quadratic function.